Properties

$suppressMergedTemplates

$suppressMergedTemplates : boolean

suppress generation of merged template code

Type

boolean

$_tag_objects

$_tag_objects : array

compile tag objects

Type

array

$_tag_stack

$_tag_stack : array

tag stack

Type

array

$merged_templates

$merged_templates : array

merged templates

Type

array

$sources

$sources : array

sources which must be compiled

Type

array

$inheritance

$inheritance : boolean

flag that we are inside {block}

Type

boolean

$inheritance_child

$inheritance_child : boolean

flag when compiling inheritance child template

Type

boolean

$extends_uid

$extends_uid : array

uid of templates called by {extends} for recursion check

Type

array

$trace_line_offset

$trace_line_offset : integer

source line offset for error messages

Type

integer

$trace_uid

$trace_uid : string

trace uid

Type

string

$trace_filepath

$trace_filepath : string

trace file path

Type

string

$trace_stack

$trace_stack : array

stack for tracing file and line of nested {block} tags

Type

array

$default_handler_plugins

$default_handler_plugins : array

plugins loaded by default plugin handler

Type

array

$default_modifier_list

$default_modifier_list : mixed

saved preprocessed modifier list

Type

mixed

$suppressHeader

$suppressHeader : boolean

suppress Smarty header code in compiled template

Type

boolean

$suppressTemplatePropertyHeader

$suppressTemplatePropertyHeader : boolean

suppress template property header code in compiled template

Type

boolean

$suppressFilter

$suppressFilter : boolean

suppress pre and post filter

Type

boolean

$write_compiled_code

$write_compiled_code : boolean

flag if compiled template file shall we written

Type

boolean

$compiles_template_function

$compiles_template_function : boolean

flag if currently a template function is compiled

Type

boolean

$called_functions

$called_functions : array

called subfuntions from template function

Type

array

$modifier_plugins

$modifier_plugins : array

flags for used modifier plugins

Type

array

$known_modifier_type

$known_modifier_type : array

type of already compiled modifier

Type

array

Methods

compileTemplate()

compileTemplate(\Smarty_Internal_Template  $template) : boolean

Method to compile a Smarty template

Parameters

\Smarty_Internal_Template $template

template object to compile

Returns

boolean —

true if compiling succeeded, false if it failed

compileTag()

compileTag(string  $tag, array  $args, array  $parameter = array()) : string

Compile Tag

This is a call back from the lexer/parser It executes the required compile plugin for the Smarty tag

Parameters

string $tag

tag name

array $args

array with tag attributes

array $parameter

array with compilation parameter

Returns

string —

compiled code

callTagCompiler()

callTagCompiler(string  $tag, array  $args, mixed  $param1 = null, mixed  $param2 = null, mixed  $param3 = null) : string

lazy loads internal compile plugin for tag and calls the compile methode

compile objects cached for reuse. class name format: Smarty_Internal_Compile_TagName plugin filename format: Smarty_Internal_Tagname.php

Parameters

string $tag

tag name

array $args

list of tag attributes

mixed $param1

optional parameter

mixed $param2

optional parameter

mixed $param3

optional parameter

Returns

string —

compiled code

getPlugin()

getPlugin(  $plugin_name, string  $plugin_type) : string

Check for plugins and return function name

Parameters

$plugin_name
string $plugin_type

type of plugin

Returns

string —

call name of function

getPluginFromDefaultHandler()

getPluginFromDefaultHandler(string  $tag, string  $plugin_type) : boolean

Check for plugins by default plugin handler

Parameters

string $tag

name of tag

string $plugin_type

type of plugin

Returns

boolean —

true if found

processNocacheCode()

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.

Parameters

string $content

content of template element

boolean $is_code

true if content is compiled code

Returns

string —

content

pushTrace()

pushTrace(string  $file, string  $uid, integer  $line, string  $debug = true) 

push current file and line offset on stack for tracing {block} source lines

Parameters

string $file

new filename

string $uid

uid of file

integer $line

line offset to source

string $debug

false debug end_compile shall not be called

popTrace()

popTrace() 

restore file and line offset

trigger_template_error()

trigger_template_error(string  $args = null, string  $line = 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

Parameters

string $args

individual error message or null

string $line

line-number

Throws

\SmartyCompilerException

when an unexpected token is found

doCompile()

doCompile(mixed  $_content) : boolean

Methode to compile a Smarty template

Parameters

mixed $_content

template source

Returns

boolean —

true if compiling succeeded, false if it failed