☸ Introduction to CCViews ☸
CCViews is a parameterizable nested view loader with an optional global-scope function API.
How to use CCViews
Put ccViews.php and (optionally) ccViewsGSFAPI.php somewhere accessible to your PHP-enabled webserver, create a folder called 'views' in the same directory, and —if you want to use the global-scope function API— include the following 2 lines in the PHP file that will act as a holder (see below for more about holders):
To create a CCViews object directly, and not use ccViewsGSFAPI.php, you can use the static factory method CCViews::create():
Replace 'path/to/' with the actual filesystem path. That's it! createViewsObject() creates a single global CCViews object (to use with the global-scope API), and both it and CCViews::create() can take 3 optional parameters (in order):
Some characteristics of views (for everyone)
Some characteristics of views (for programmers)
The URL syntax
Since the views can be nested, and can be specified in the URL's query string, understanding the URL syntax is important if you want to use viewByIndex().
The URL syntax is as follows.
holder.php is the file that holds the views (the 'holder', e.g. this page);
all parameters are optional;
dx, means 'depth' x (the depth of the groups, starting at depth 0);
each group has the form:
viewName,viewName,...viewName[n], where viewName[i] is the name of a view file in the 'views' folder, without its extension;
each group represents a view—that has children (subviews)—in the depth above that depth;
trace means show the trace tree (tracing can also be forced by setting $g_alwaysDoTrace in ccViews.php).
Each trace item has the form:
or, if the view is loaded using viewByName():
where '|' indicates the depth.
The CCViews Server
The CCViews Viewer (ccViewsViewer.php) works with the CCViews Server (ccViewsServer.php) to let you share your views with others. It requires that the 'zip' utility (available at info-zip.org) be callable from PHP via exec().