$smarty
$smarty : \Smarty
Smarty object
Main abstract compiler class
$smarty : \Smarty
Smarty object
$parser : \Smarty_Internal_Templateparser
Parser object
$template : \Smarty_Internal_Template
current template
$parent_compiler : \Smarty_Internal_TemplateCompilerBase
parent compiler object for merged subtemplates and template functions
__construct(\Smarty $smarty)
Initialize compiler
\Smarty | $smarty | global instance |
compileTemplate(\Smarty_Internal_Template $template, boolean $nocache = null, null|\Smarty_Internal_TemplateCompilerBase $parent_compiler = null) : boolean
Method to compile a Smarty template
\Smarty_Internal_Template | $template | template object to compile |
boolean | $nocache | true is shall be compiled in nocache mode |
null|\Smarty_Internal_TemplateCompilerBase | $parent_compiler |
true if compiling succeeded, false if it failed
compileTemplateSource(\Smarty_Internal_Template $template, null|boolean $nocache = null, \Smarty_Internal_TemplateCompilerBase $parent_compiler = null) : string
Compile template source and run optional post filter
\Smarty_Internal_Template | $template | |
null|boolean | $nocache | flag if template must be compiled in nocache mode |
\Smarty_Internal_TemplateCompilerBase | $parent_compiler |
compileTag(string $tag, array $args, array $parameter = array()) : string
Compile Tag This is a call back from the lexer/parser
Save current prefix code Compile tag Merge tag prefix code with saved one (required nested tags in attributes)
string | $tag | tag name |
array | $args | array with tag attributes |
array | $parameter | array with compilation parameter |
compiled code
processText(string $text) : null|\Smarty_Internal_ParseTree_Text
This method is called from parser to process a text content section - remove text from inheritance child templates as they may generate output - strip text if strip is enabled
string | $text |
callTagCompiler(string $tag, array $args, mixed $param1 = null, mixed $param2 = null, mixed $param3 = null) : string|boolean
lazy loads internal compile plugin for tag and calls the compile method compile objects cached for reuse.
class name format: Smarty_Internal_Compile_TagName plugin filename format: Smarty_Internal_TagName.php
string | $tag | tag name |
array | $args | list of tag attributes |
mixed | $param1 | optional parameter |
mixed | $param2 | optional parameter |
mixed | $param3 | optional parameter |
compiled code or false
getTagCompiler(string $tag) : \Smarty_Internal_CompileBase|boolean
lazy loads internal compile plugin for tag compile objects cached for reuse.
class name format: Smarty_Internal_Compile_TagName plugin filename format: Smarty_Internal_TagName.php
string | $tag | tag name |
tag compiler object or false if not found
processNocacheCode(string $content, boolean $is_code) : string
Inject inline code for nocache template sections This method gets the content of each template element from the parser.
If the content is compiled code and it should be not cached the code is injected into the rendered output.
string | $content | content of template element |
boolean | $is_code | true if content is compiled code |
content
trigger_template_error(string $args = null, string $line = null, null|boolean $tagline = null)
display compiler error messages without dying If parameter $args is empty it is a parser detected syntax error.
In this case the parser is called to obtain information about expected tokens. If parameter $args contains a string this is used as error message
string | $args | individual error message or null |
string | $line | line-number |
null|boolean | $tagline | if true the line number of last tag |
when an unexpected token is found