Comments: on this page. Click to read or post your own.
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:
Located in /sapphire/core/SSViewer.php (line 50)
Object | --SSViewer
| Class | Description |
|---|---|
| SSViewer_FromString | Special SSViewer that will process a template passed as a string, rather than a filename. |
Inherited from Object
Object::$builtInMethods
Object::$class
Object::$classConstructed
Object::$extensions
Object::$extension_instances
Object::$extraMethods
Object::$extraStatics
Object::$statics
Object::$static_cached
Clears all parsed template files in the cache folder.
Can only be called once per request (there may be multiple SSViewer instances).
Create a template from a string instead of a .ss file
Used by <% include Identifier %> statements to get the full unparsed content of a template file.
Searches for a template name in the current theme:
Caution: Doesn't search in any /Layout folders.
Returns true if at least one of the listed templates exists
Set a global rendering option.
The following options are available:
Pass the SilverStripe template to be used.
Call this to disable rewriting of <a href="#xxx"> links. This is useful in Ajax applications.
It returns the SSViewer objects, so that you can call new SSViewer("X")->dontRewriteHashlinks()->process();
The process() method handles the "meat" of the template processing.
Returns the filenames of the template that will be rendered. It is a map that may contain
'Content' & 'Layout', and will have to contain 'main'
Inherited From Object
Object::__construct()
Object::addMethodsFrom()
Object::addStaticVars()
Object::addWrapperMethod()
Object::add_extension()
Object::allMethodNames()
Object::buildMethodList()
Object::cacheToFile()
Object::cacheToFileWithArgs()
Object::create()
Object::createMethod()
Object::defineMethods()
Object::exists()
Object::extend()
Object::extInstance()
Object::getCustomClass()
Object::hasExtension()
Object::hasMethod()
Object::invokeWithExtensions()
Object::is_a()
Object::loadCache()
Object::parentClass()
Object::sanitiseCachename()
Object::saveCache()
Object::set_stat()
Object::set_uninherited()
Object::stat()
Object::strong_create()
Object::uninherited()
Object::useCustomClass()
Object::__call()
Object::__toString()
Documentation generated on Sun, 19 Oct 2008 06:46:25 +1300 by phpDocumentor 1.3.2