<< Back to Dashboard

Contents

Exploring the CFCViewer Plugin

Overview

This plugin provides functionality to obtain information about CFCs via introspection and generate cool documentation about them.

setRenderingTemplate

Set the rendering template to use instead of the default ColdBox one.

Returns

Arguments

Key Type Required Default Description
RenderingTemplate string Yes ---

Examples

getPlugin("CFCViewer").setRenderingTemplate("/includes/MyDocs.cfm");

renderit

Render the content

Returns

Examples

// Choose where you want the docs to be rendered:
<div id="content">
#getPlugin("CFCViewer").renderit()#
</div>

getDirpath

Get the dirpath of where the cfc's reside. This is expanded.

Returns

getaCFC

returns an array with the names of all components within the current directory

Returns

Examples

// mostly used when building your own rendering templates
<cfloop array="#getPlugin("CFCViewer").getaCFC()#">

</cfloop>

setup

Use this method to initialize for documentation. You must persist it in your request so you can do renderings and interact with the object.

Returns

Arguments

Key Type Required Default Description
dirpath string Yes --- The directory path to which is the root of what you want the cfcviewer to report on. This must be a valid instantiation path: ex: /coldbox/system
accessTypesFilter string No Use this argument to only display methods with the access types given. If empty, displays all methods (public, private, remote, package).
dirLink string No --- If you pass this. it will create a linkable directory or package structure according to the link provided and append an internal package variable.
jsLink string No --- If you pass this, it will create a linkable package according to the js provided. Also, place a @package@ on your link, so it can correctly identify where to place the url parameter for the package choosen
RenderingTemplate string No --- Override the rendering template with yours
LinkBaseURL string No --- The base url to use for anchors

Examples

// setup the documentation 
viewer = getPlugin("CFCViewer").setup(dirPath="/coldbox/system/plugins",linkBaseURL=getSetting('sesBaseURL'));

// setup the documentation 
viewer = getPlugin("CFCViewer").setup(dirPath="/coldbox/system/plugins",accessTypeFilter="public,remote");

// setup the documentation via JS links
viewer = getPlugin("CFCViewer").setup(dirPath="/coldbox/system/plugins",jsLink="changeDocs('@package@')");

setStyleSheet

Set the stylesheet to use when rendering the documentation

Returns

Arguments

Key Type Required Default Description
styleSheet string Yes ---

Examples

viewer.setStyleSheet('includes/docs/mydocs.css');

getaPacks

Get aPacks

Returns

Examples

// get the packages array that is found in the current documentation directory
packages = viewer.getaPacks();