SSViewer_FromString
class SSViewer_FromString extends SSViewer
Special SSViewer that will process a template passed as a string, rather than a filename.
Config options
cache_template | bool | The global template caching behaviour if no instance override is specified |
Methods
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
Create a template from a string instead of a .ss file
Returns an array of theme names present in a directory.
Traverses the given the given class context looking for templates with the relevant name.
Returns true if at least one of the listed templates exists.
Call this to disable rewriting of links. This is useful in Ajax applications.
Clears all parsed template files in the cache folder.
Set the cache object to use when storing / retrieving partial cache blocks.
Get the cache object to use when storing / retrieving partial cache blocks.
Flag whether to include the requirements in this response.
The process() method handles the "meat" of the template processing.
Execute the given template, passing it the given data.
Execute the evaluated string, passing it the given data.
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'
Return an appropriate base tag for the given template.
No description
No description
Details
in SSViewer at line 705
static
set_source_file_comments(boolean $val)
deprecated
deprecated 4.0 Use the "SSViewer.source_file_comments" config setting instead
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
in SSViewer at line 714
static boolean
get_source_file_comments()
deprecated
deprecated 4.0 Use the "SSViewer.source_file_comments" config setting instead
in SSViewer at line 768
static
flush()
Triggered early in the request when someone requests a flush.
in SSViewer at line 780
static SSViewer
fromString(string $content, bool|void $cacheTemplate = null)
Create a template from a string instead of a .ss file
in SSViewer at line 792
static
set_theme(string $theme)
deprecated
deprecated 4.0 Use the "SSViewer.theme" config setting instead
in SSViewer at line 801
static string
current_theme()
deprecated
deprecated 4.0 Use the "SSViewer.theme" config setting instead
in SSViewer at line 811
static string
get_theme_folder()
Returns the path to the theme folder
in SSViewer at line 823
static array
get_themes(string $path = null, bool $subthemes = false)
Returns an array of theme names present in a directory.
in SSViewer at line 844
static string
current_custom_theme()
deprecated
deprecated since version 4.0
in SSViewer at line 858
static array
get_templates_by_class($className, $suffix = '', $baseClass = null)
Traverses the given the given class context looking for templates with the relevant name.
at line 1362
__construct($content, TemplateParser $parser = null)
in SSViewer at line 926
setParser(TemplateParser $parser)
Set the template parser that will be used in template generation
in SSViewer at line 935
TemplateParser
getParser()
Returns the parser that is set for template generation
in SSViewer at line 950
static boolean
hasTemplate(array $templates)
Returns true if at least one of the listed templates exists.
in SSViewer at line 980
static
setOption(string $optionName, mixed $optionVal)
deprecated
deprecated 4.0 Use the "SSViewer.rewrite_hash_links" config setting instead
Set a global rendering option.
The following options are available:
- rewriteHashlinks: If true (the default), will be rewritten to contain the
current URL. This lets it play nicely with our
static mixed
getOption(string $optionName)
deprecated
deprecated 4.0 Use the "SSViewer.rewrite_hash_links" config setting instead
in SSViewer at line 1013
static
topLevel()
in SSViewer at line 1031
dontRewriteHashlinks()
Call this to disable rewriting of links. This is useful in Ajax applications.
It returns the SSViewer objects, so that you can call new SSViewer("X")->dontRewriteHashlinks()->process();
in SSViewer at line 1047
static string
getTemplateFileByType(string $identifier, string $type)
in SSViewer at line 1073
static
flush_template_cache(bool $force = false)
Clears all parsed template files in the cache folder.
Can only be called once per request (there may be multiple SSViewer instances).
in SSViewer at line 1091
static
flush_cacheblock_cache(bool $force = false)
Clears all partial cache blocks.
Can only be called once per request (there may be multiple SSViewer instances).
in SSViewer at line 1121
setPartialCacheStore(Zend_Cache_Core $cache)
Set the cache object to use when storing / retrieving partial cache blocks.
in SSViewer at line 1130
Zend_Cache_Core
getPartialCacheStore()
Get the cache object to use when storing / retrieving partial cache blocks.
in SSViewer at line 1139
includeRequirements(boolean $incl = true)
Flag whether to include the requirements in this response.
at line 1370
HTMLText
process(ViewableData $item, array|null $arguments = null, $scope = null)
The process() method handles the "meat" of the template processing.
It takes care of caching the output (via {@link SS_Cache}), as well as replacing the special "$Content" and "$Layout" placeholders with their respective subtemplates.
The method injects extra HTML in the header via {@link Requirements::includeInHTML()}.
Note: You can call this method indirectly by {@link ViewableData->renderWith()}.
in SSViewer at line 1269
static string
execute_template($template, $data, $arguments = null, $scope = null)
Execute the given template, passing it the given data.
Used by the <% include %> template tag to process templates.
in SSViewer at line 1286
static string
execute_string(string $content, mixed $data, array $arguments = null)
Execute the evaluated string, passing it the given data.
Used by partial caching to evaluate custom cache keys expressed using template expressions
in SSViewer at line 1293
parseTemplateContent($content, $template = "")
in SSViewer at line 1305
templates()
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'
in SSViewer at line 1313
setTemplateFile(string $type, string $file)
in SSViewer at line 1324
static
get_base_tag($contentGeneratedSoFar)
Return an appropriate base tag for the given template.
It will be closed on an XHTML document, and unclosed on an HTML document.