68 Classifieds API

Features
class tree: Smarty | index: Smarty | all elements

 Class Smarty_Compiler

Description

Template compiling class

Located in /includes/classes/smarty/Smarty_Compiler.class.php (line 35)

Smarty
   |
   --Smarty_Compiler
Method Summary
 Smarty_Compiler Smarty_Compiler ()
 void _add_plugin (string $type, string $name, [boolean? $delayed_loading = null])
 void _compile_arg_list ( $type,  $name,  $attrs,  &$cache_code)
 boolean _compile_block_tag (string $tag_command, string $tag_args, string $tag_modifier,  &$output, string $output)
 string _compile_capture_tag (boolean $start, [string $tag_args = ''])
 boolean _compile_compiler_tag (string $tag_command, string $tag_args,  &$output, string $output)
 string _compile_custom_tag (string $tag_command, string $tag_args, string $tag_modifier,  &$output)
 true _compile_file (string $resource_name, string $source_content,  &$compiled_content, string $compiled_content)
 string _compile_foreach_start (string $tag_args)
 string _compile_if_tag (string $tag_args, [boolean $elseif = false])
 string _compile_include_php_tag (string $tag_args)
 string _compile_include_tag (string $tag_args)
 string _compile_insert_tag (string $tag_args)
 string _compile_plugin_call (string $type, string $name)
 string _compile_registered_object_tag (string $tag_command, array $attrs, string $tag_modifier)
 string _compile_section_start (string $tag_args)
 string _compile_smarty_ref ( &$indexes, string $indexes)
 string _compile_tag (string $template_tag)
 string _expand_quoted_text (string $var_expr)
 void _load_filters ()
 array _parse_attrs (string $tag_args)
 void _parse_conf_var (string $conf_var_expr)
 array _parse_is_expr (string $is_arg, array $tokens)
 void _parse_modifiers ( &$output, string $modifier_string, string $output)
 string _parse_parenth_args (string $parenth_args)
 string _parse_section_prop (string $section_prop_expr)
 string _parse_var (string $var_expr, string $output)
 void _parse_vars_props ( &$tokens, array $tokens)
 string _parse_var_props (string $val, string $tag_attrs)
 string _pop_cacheable_state ( $type,  $name)
 string _pop_tag (string $close_tag)
 string _push_cacheable_state ( $type,  $name)
 void _push_tag (string $open_tag)
 string _quote_replace (string $string)
 void _syntax_error (string $error_msg, [integer $error_type = E_USER_ERROR], [string $file = null], [integer $line = null])
Methods
Constructor Smarty_Compiler (line 84)

The class constructor.

Smarty_Compiler Smarty_Compiler ()
_add_plugin (line 1997)

add plugin

void _add_plugin (string $type, string $name, [boolean? $delayed_loading = null])
  • string $type
  • string $name
  • boolean? $delayed_loading
_compile_arg_list (line 1432)
void _compile_arg_list ( $type,  $name,  $attrs,  &$cache_code)
  • $type
  • $name
  • $attrs
  • &$cache_code
_compile_block_tag (line 684)

compile block function tag

sets $output to compiled block function tag

boolean _compile_block_tag (string $tag_command, string $tag_args, string $tag_modifier,  &$output, string $output)
  • string $tag_command
  • string $tag_args
  • string $tag_modifier
  • string $output
  • &$output
_compile_capture_tag (line 1229)

Compile {capture} .. {/capture} tags

string _compile_capture_tag (boolean $start, [string $tag_args = ''])
  • boolean $start: true if this is the {capture} tag
  • string $tag_args
_compile_compiler_tag (line 615)

compile the custom compiler tag

sets $output to the compiled custom compiler tag

boolean _compile_compiler_tag (string $tag_command, string $tag_args,  &$output, string $output)
  • string $tag_command
  • string $tag_args
  • string $output
  • &$output
_compile_custom_tag (line 775)

compile custom function tag

string _compile_custom_tag (string $tag_command, string $tag_args, string $tag_modifier,  &$output)
  • string $tag_command
  • string $tag_args
  • string $tag_modifier
  • &$output
_compile_file (line 234)

compile a resource

sets $compiled_content to the compiled source

true _compile_file (string $resource_name, string $source_content,  &$compiled_content, string $compiled_content)
  • string $resource_name
  • string $source_content
  • string $compiled_content
  • &$compiled_content
_compile_foreach_start (line 1168)

Compile {foreach ...} tag.

string _compile_foreach_start (string $tag_args)
  • string $tag_args
_compile_if_tag (line 1262)

Compile {if ...} tag

string _compile_if_tag (string $tag_args, [boolean $elseif = false])
  • string $tag_args
  • boolean $elseif: if true, uses elseif instead of if
_compile_include_php_tag (line 1031)

Compile {include ...} tag

string _compile_include_php_tag (string $tag_args)
  • string $tag_args
_compile_include_tag (line 978)

Compile {include ...} tag

string _compile_include_tag (string $tag_args)
  • string $tag_args
_compile_insert_tag (line 940)

Compile {insert ...} tag

string _compile_insert_tag (string $tag_args)
  • string $tag_args
_compile_plugin_call (line 2172)

compiles call to plugin of type $type with name $name

returns a string containing the function-name or method call without the paramter-list that would have follow to make the call valid php-syntax

string _compile_plugin_call (string $type, string $name)
  • string $type
  • string $name
_compile_registered_object_tag (line 848)

compile a registered object tag

string _compile_registered_object_tag (string $tag_command, array $attrs, string $tag_modifier)
  • string $tag_command
  • array $attrs
  • string $tag_modifier
_compile_section_start (line 1063)

Compile {section ...} tag

string _compile_section_start (string $tag_args)
  • string $tag_args
_compile_smarty_ref (line 2016)

Compiles references of type $smarty.foo

string _compile_smarty_ref ( &$indexes, string $indexes)
  • string $indexes
  • &$indexes
_compile_tag (line 444)

Compile a template tag

string _compile_tag (string $template_tag)
  • string $template_tag
_expand_quoted_text (line 1692)

expand quoted text with embedded variables

string _expand_quoted_text (string $var_expr)
  • string $var_expr
_load_filters (line 2196)

load pre- and post-filters

void _load_filters ()
_parse_attrs (line 1533)

Parse attribute string

array _parse_attrs (string $tag_args)
  • string $tag_args
_parse_conf_var (line 1882)

parse configuration variable expression into PHP code

void _parse_conf_var (string $conf_var_expr)
  • string $conf_var_expr
_parse_is_expr (line 1472)

Parse is expression

array _parse_is_expr (string $is_arg, array $tokens)
  • string $is_arg
  • array $tokens
_parse_modifiers (line 1928)

parse modifier chain into PHP code

sets $output to parsed modified chain

void _parse_modifiers ( &$output, string $modifier_string, string $output)
  • string $output
  • string $modifier_string
  • &$output
_parse_parenth_args (line 1865)

parse arguments in function call parenthesis

string _parse_parenth_args (string $parenth_args)
  • string $parenth_args
_parse_section_prop (line 1903)

parse section property expression into PHP code

string _parse_section_prop (string $section_prop_expr)
  • string $section_prop_expr
_parse_var (line 1720)

parse variable expression into PHP code

string _parse_var (string $var_expr, string $output)
  • string $var_expr
  • string $output
_parse_vars_props (line 1617)

compile multiple variables and section properties tokens into PHP code

void _parse_vars_props ( &$tokens, array $tokens)
  • array $tokens
  • &$tokens
_parse_var_props (line 1632)

compile single variable and section properties token into PHP code

string _parse_var_props (string $val, string $tag_attrs)
  • string $val
  • string $tag_attrs
_pop_cacheable_state (line 2270)

check if the compilation changes from non-cacheable to cacheable state with the end of the current plugin return php-code to reflect the transition.

string _pop_cacheable_state ( $type,  $name)
  • $type
  • $name
_pop_tag (line 2295)

pop closing tag-name

raise an error if this stack-top doesn't match with the closing tag

  • return: the opening tag's name
string _pop_tag (string $close_tag)
  • string $close_tag: the closing tag's name
_push_cacheable_state (line 2252)

check if the compilation changes from cacheable to non-cacheable state with the beginning of the current plugin. return php-code to reflect the transition.

string _push_cacheable_state ( $type,  $name)
  • $type
  • $name
_push_tag (line 2284)

push opening tag-name, file-name and line-number on the tag-stack

void _push_tag (string $open_tag)
  • string $open_tag: the opening tag's name
_quote_replace (line 2227)

Quote subpattern references

string _quote_replace (string $string)
  • string $string
_syntax_error (line 2240)

display Smarty syntax error

void _syntax_error (string $error_msg, [integer $error_type = E_USER_ERROR], [string $file = null], [integer $line = null])
  • string $error_msg
  • integer $error_type
  • string $file
  • integer $line

Inherited Methods

Inherited From Smarty

 Smarty::Smarty()
 Smarty::append()
 Smarty::append_by_ref()
 Smarty::assign()
 Smarty::assign_by_ref()
 Smarty::clear_all_assign()
 Smarty::clear_all_cache()
 Smarty::clear_assign()
 Smarty::clear_cache()
 Smarty::clear_compiled_tpl()
 Smarty::clear_config()
 Smarty::config_load()
 Smarty::display()
 Smarty::fetch()
 Smarty::get_config_vars()
 Smarty::get_registered_object()
 Smarty::get_template_vars()
 Smarty::is_cached()
 Smarty::load_filter()
 Smarty::register_block()
 Smarty::register_compiler_function()
 Smarty::register_function()
 Smarty::register_modifier()
 Smarty::register_object()
 Smarty::register_outputfilter()
 Smarty::register_postfilter()
 Smarty::register_prefilter()
 Smarty::register_resource()
 Smarty::template_exists()
 Smarty::trigger_error()
 Smarty::unregister_block()
 Smarty::unregister_compiler_function()
 Smarty::unregister_function()
 Smarty::unregister_modifier()
 Smarty::unregister_object()
 Smarty::unregister_outputfilter()
 Smarty::unregister_postfilter()
 Smarty::unregister_prefilter()
 Smarty::unregister_resource()
 Smarty::_compile_resource()
 Smarty::_compile_source()
 Smarty::_dequote()
 Smarty::_eval()
 Smarty::_fetch_resource_info()
 Smarty::_get_auto_filename()
 Smarty::_get_auto_id()
 Smarty::_get_compile_path()
 Smarty::_get_filter_name()
 Smarty::_get_plugin_filepath()
 Smarty::_include()
 Smarty::_is_compiled()
 Smarty::_parse_resource_name()
 Smarty::_process_compiled_include_callback()
 Smarty::_read_file()
 Smarty::_run_mod_handler()
 Smarty::_smarty_cache_attrs()
 Smarty::_smarty_include()
 Smarty::_trigger_fatal_error()
 Smarty::_unlink()