Class SSViewer
The SSViewer executes a .ss template file. The SSViewer class handles rendering of .ss templates. In addition to a full template in the views folder, a template in views/Content or views/Layout will be rendered into $Content and $Layout, respectively.
Compiled templates are cached. If you put ?flush=1 on your URL, it will force the template to be recompiled. This is a hack; the system should really detect when a page needs re-fetching.
Works with the global $_TEMPLATE_MANIFEST which is compiled by ManifestBuilder->getTemplateManifest(). This associative array lists all template filepaths by "identifier", meaning the name of the template without its path or extension.
Example:
array( 'LeftAndMain' => array ( 'main' => '/my/system/path/cms/templates/LeftAndMain.ss', ), 'CMSMain_left' => array ( 'Includes' => '/my/system/path/cms/templates/Includes/CMSMain_left.ss', ), 'Page' => array ( 'themes' => array ( 'blackcandy' => array ( 'Layout' => '/my/system/path/themes/blackcandy/templates/Layout/Page.ss', 'main' => '/my/system/path/themes/blackcandy/templates/Page.ss', ), 'blue' => array ( 'Layout' => '/my/system/path/themes/mysite/templates/Layout/Page.ss', 'main' => '/my/system/path/themes/mysite/templates/Page.ss', ), ), ), // ... )
Direct known subclasses
Methods summary
public static
|
#
set_source_file_comments( boolean $val )
Set whether HTML comments indicating the source .SS file used to render this page should be included in the output. This is enabled by default |
public static
boolean
|
|
public static
|
|
public static
|
|
public static
string
|
|
public static
string
|
|
public
|
|
public static
|
|
public static
|
#
setOption( mixed $optionName, mixed $optionVal )
Set a global rendering option. The following options are available: |
public static
|
|
public
|
|
public
|
|
public static
string
|
#
getTemplateFile( string $identifier )
Searches for a template name in the current theme:
Falls back to unthemed template files. |
public static
string
|
|
public static
string
|
#
getTemplateContent( string $identifier )
Used by <% include Identifier %> statements to get the full unparsed content of a template file. |
public static
|
|
public
|
|
public static
|
|
public
|
|
public
|
|
public static
|
#
get_base_tag( mixed $contentGeneratedSoFar )
Return an appropriate base tag for the given template. It will be closed on an XHTML document, and unclosed on an HTML document. |
Magic methods summary
Properties summary
protected static
boolean
|
$source_file_comments |
#
$source_file_comments |
protected
boolean
|
$rewriteHashlinks | |
protected static
string
|
$current_theme | |
protected static
string
|
$current_custom_theme | |
protected static
array
|
$options | |
protected static
array
|
$topLevel |