package |
Smarty |
subpackage |
Compiler |
Methods
Initialize compiler
__construct(string $lexer_class, string $parser_class, \Smarty $smarty)
Parameters
$lexer_class
string
class name
$parser_class
string
class name
lazy loads internal compile plugin for tag and calls the compile methode
callTagCompiler(string $tag, array $args, mixed $param1, mixed $param2, mixed $param3) : string
Inherited
compile objects cached for reuse.
class name format: Smarty_Internal_Compile_TagName
plugin filename format: Smarty_Internal_Tagname.php
inherited_from |
\Smarty_Internal_TemplateCompilerBase::callTagCompiler() |
Parameters
$args
array
list of tag attributes
$param1
mixed
optional parameter
$param2
mixed
optional parameter
$param3
mixed
optional parameter
Returns
string
compiled code
Compile Tag
compileTag(string $tag, array $args, array $parameter) : string
Inherited
This is a call back from the lexer/parser
It executes the required compile plugin for the Smarty tag
inherited_from |
\Smarty_Internal_TemplateCompilerBase::compileTag() |
Parameters
$args
array
array with tag attributes
$parameter
array
array with compilation parameter
Returns
string
compiled code
Method to compile a Smarty template
compileTemplate(\Smarty_Internal_Template $template) : bool
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::compileTemplate() |
Parameters
Returns
bool
true if compiling succeeded, false if it failed
Check for plugins and return function name
getPlugin($plugin_name, string $plugin_type) : string
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::getPlugin() |
Parameters
$plugin_name
$plugin_type
string
type of plugin
Returns
string
call name of function
Check for plugins by default plugin handler
getPluginFromDefaultHandler(string $tag, string $plugin_type) : boolean
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::getPluginFromDefaultHandler() |
Parameters
$plugin_type
string
type of plugin
Returns
boolean
true if found
Inject inline code for nocache template sections
processNocacheCode(string $content, boolean $is_code) : string
Inherited
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.
inherited_from |
\Smarty_Internal_TemplateCompilerBase::processNocacheCode() |
Parameters
$content
string
content of template element
$is_code
boolean
true if content is compiled code
Returns
string
content
display compiler error messages without dying
trigger_template_error(string $args, string $line)
Inherited
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
inherited_from |
\Smarty_Internal_TemplateCompilerBase::trigger_template_error() |
Parameters
$args
string
individual error message or null
Exceptions
Methode to compile a Smarty template
doCompile(mixed $_content) : bool
Parameters
$_content
mixed
template source
Returns
bool
true if compiling succeeded, false if it failed
Properties
$_tag_objects : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$_tag_objects |
$_tag_stack : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$_tag_stack |
$called_functions : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$called_functions |
$compiles_template_function : bool
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$compiles_template_function |
$default_handler_plugins : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$default_handler_plugins |
$default_modifier_list : mixed
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$default_modifier_list |
$forceNocache : boolean
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$forceNocache |
$inheritance : bool
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$inheritance |
$known_modifier_type : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$known_modifier_type |
$merged_templates : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$merged_templates |
$modifier_plugins : array
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$modifier_plugins |
$suppressMergedTemplates : bool
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$suppressMergedTemplates |
$suppressNocacheProcessing : bool
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$suppressNocacheProcessing |
$write_compiled_code : bool
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$write_compiled_code |
$nocache_hash : mixed
Inherited
inherited_from |
\Smarty_Internal_TemplateCompilerBase::$$nocache_hash |