Class Smarty_Internal_TemplateCompilerBase

Description

Main abstract compiler class

  • abstract:

Located in /libs/sysplugins/smarty_internal_templatecompilerbase.php (line 18)


	
			
Direct descendents
Class Description
Smarty_Internal_SmartyTemplateCompiler Class SmartyTemplateCompiler
Variable Summary
Method Summary
Smarty_Internal_TemplateCompilerBase __construct ()
string callTagCompiler (string $tag, array $args, [mixed $param1 = null], [mixed $param2 = null], [mixed $param3 = null])
string compileTag (string $tag, array $args, [array $parameter = array()])
string getPlugin ( $plugin_name, string $plugin_type, string $pugin_name)
boolean getPluginFromDefaultHandler (string $tag, string $plugin_type)
string processNocacheCode (string $content, boolean $is_code)
void trigger_template_error ([string $args = null], [string $line = null])
Variables
static array $_tag_objects = array() (line 43)

compile tag objects

  • access: public
array $default_handler_plugins = array() (line 73)

plugins loaded by default plugin handler

  • access: public
mixed $default_modifier_list = null (line 79)

saved preprocessed modifier list

  • access: public
boolean $forceNocache = false (line 84)

force compilation of complete template as nocache

  • access: public
bool $inheritance = false (line 67)

flag when compiling {block}

  • access: public
array $merged_templates = array() (line 61)

merged templates

  • access: public
array $modifier_plugins = array() (line 104)

flags for used modifier plugins

  • access: public
bool $suppressHeader = false (line 89)

suppress Smarty header code in compiled template

  • access: public
bool $suppressMergedTemplates = false (line 37)

suppress generation of merged template code

  • access: public
bool $suppressNocacheProcessing = false (line 31)

suppress generation of nocache code

  • access: public
bool $suppressTemplatePropertyHeader = false (line 94)

suppress template property header code in compiled template

  • access: public
Smarty_Internal_Template $template = null (line 55)

current template

  • access: public
bool $write_compiled_code = true (line 99)

flag if compiled template file shall we written

  • access: public
array $_tag_stack = array() (line 49)

tag stack

  • access: public
Methods
Constructor __construct (line 109)

Initialize compiler

  • access: public
Smarty_Internal_TemplateCompilerBase __construct ()

Redefined in descendants as:
callTagCompiler (line 408)

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

  • return: compiled code
  • access: public
string callTagCompiler (string $tag, array $args, [mixed $param1 = null], [mixed $param2 = null], [mixed $param3 = null])
  • string $tag: tag name
  • array $args: list of tag attributes
  • mixed $param1: optional parameter
  • mixed $param2: optional parameter
  • mixed $param3: optional parameter
compileTag (line 195)

Compile Tag

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

  • return: compiled code
  • access: public
string compileTag (string $tag, array $args, [array $parameter = array()])
  • string $tag: tag name
  • array $args: array with tag attributes
  • array $parameter: array with compilation parameter
compileTemplate (line 120)

Method to compile a Smarty template

  • return: true if compiling succeeded, false if it failed
  • access: public
bool compileTemplate (Smarty_Internal_Template $template)
getPlugin (line 437)

Check for plugins and return function name

  • return: call name of function
  • access: public
string getPlugin ( $plugin_name, string $plugin_type, string $pugin_name)
  • string $pugin_name: name of plugin or function
  • string $plugin_type: type of plugin
  • $plugin_name
getPluginFromDefaultHandler (line 492)

Check for plugins by default plugin handler

  • return: true if found
  • access: public
boolean getPluginFromDefaultHandler (string $tag, string $plugin_type)
  • string $tag: name of tag
  • string $plugin_type: type of plugin
processNocacheCode (line 536)

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.

  • return: content
  • access: public
string processNocacheCode (string $content, boolean $is_code)
  • string $content: content of template element
  • boolean $is_code: true if content is compiled code
trigger_template_error (line 577)

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

  • throws: SmartyCompilerException when an unexpected token is found
  • access: public
void trigger_template_error ([string $args = null], [string $line = null])
  • string $args: individual error message or null
  • string $line: line-number

Documentation generated on Sat, 24 Sep 2011 20:24:03 +0200 by phpDocumentor 1.4.1