Class: Smarty_Compiler

Source Location: /bblog/libs/Smarty_Compiler.class.php ( Revision Log )

Class Smarty_Compiler

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Smarty

Smarty::$autoload_filters
Smarty::$cache_dir
Smarty::$cache_handler_func
Smarty::$cache_lifetime
Smarty::$cache_modified_check
Smarty::$caching
Smarty::$compiler_class
Smarty::$compiler_file
Smarty::$compile_check
Smarty::$compile_dir
Smarty::$compile_id
Smarty::$config_booleanize
Smarty::$config_class
Smarty::$config_dir
Smarty::$config_fix_newlines
Smarty::$config_overwrite
Smarty::$config_read_hidden
Smarty::$debugging
Smarty::$debugging_ctrl
Smarty::$debug_tpl
Smarty::$default_modifiers
Smarty::$default_resource_type
Smarty::$default_template_handler_func
Smarty::$error_reporting
Smarty::$force_compile
Smarty::$left_delimiter
Smarty::$php_handling
Smarty::$plugins_dir
Smarty::$request_use_auto_globals
Smarty::$request_vars_order
Smarty::$right_delimiter
Smarty::$secure_dir
Smarty::$security
Smarty::$security_settings
Smarty::$template_dir
Smarty::$trusted_dir
Smarty::$use_sub_dirs

Inherited From Smarty

Smarty::Smarty()
The class constructor.
Smarty::append()
appends values to template variables
Smarty::append_by_ref()
appends values to template variables by reference
Smarty::assign()
assigns values to template variables
Smarty::assign_by_ref()
assigns values to template variables by reference
Smarty::clear_all_assign()
clear all the assigned template variables.
Smarty::clear_all_cache()
clear the entire contents of cache (all templates)
Smarty::clear_assign()
clear the given assigned template variable.
Smarty::clear_cache()
clear cached content for the given template and cache id
Smarty::clear_compiled_tpl()
clears compiled version of specified template resource, or all compiled template files if one is not specified.
Smarty::clear_config()
clear configuration values
Smarty::config_load()
load configuration values
Smarty::display()
executes & displays the template results
Smarty::fetch()
executes & returns or displays the template results
Smarty::get_config_vars()
Returns an array containing config variables
Smarty::get_registered_object()
return a reference to a registered object
Smarty::get_template_vars()
Returns an array containing template variables
Smarty::is_cached()
test to see if valid cache exists for this template
Smarty::load_filter()
load a filter of specified type and name
Smarty::register_block()
Registers block function to be used in templates
Smarty::register_compiler_function()
Registers compiler function
Smarty::register_function()
Registers custom function to be used in templates
Smarty::register_modifier()
Registers modifier to be used in templates
Smarty::register_object()
Registers object to be used in templates
Smarty::register_outputfilter()
Registers an output filter function to apply to a template output
Smarty::register_postfilter()
Registers a postfilter function to apply to a compiled template after compilation
Smarty::register_prefilter()
Registers a prefilter function to apply to a template before compiling
Smarty::register_resource()
Registers a resource to fetch a template
Smarty::template_exists()
Checks whether requested template exists.
Smarty::trigger_error()
trigger Smarty error
Smarty::unregister_block()
Unregisters block function
Smarty::unregister_compiler_function()
Unregisters compiler function
Smarty::unregister_function()
Unregisters custom function
Smarty::unregister_modifier()
Unregisters modifier
Smarty::unregister_object()
Unregisters object
Smarty::unregister_outputfilter()
Unregisters an outputfilter function
Smarty::unregister_postfilter()
Unregisters a postfilter function
Smarty::unregister_prefilter()
Unregisters a prefilter function
Smarty::unregister_resource()
Unregisters a resource
Smarty::_compile_resource()
compile the template
Smarty::_compile_source()
compile the given source
Smarty::_dequote()
Remove starting and ending quotes from the string
Smarty::_eval()
wrapper for eval() retaining $this
Smarty::_fetch_resource_info()
fetch the template info. Gets timestamp, and source if get_source is true
Smarty::_get_auto_filename()
get a concrete filename for automagically created content
Smarty::_get_auto_id()
returns an auto_id for auto-file-functions
Smarty::_get_compile_path()
Get the compile path for this resource
Smarty::_get_plugin_filepath()
get filepath of requested plugin
Smarty::_include()
wrapper for include() retaining $this
Smarty::_is_compiled()
test if resource needs compiling
Smarty::_parse_resource_name()
parse out the type and name from the resource
Smarty::_process_compiled_include_callback()
callback function for preg_replace, to call a non-cacheable block
Smarty::_read_file()
read in a file
Smarty::_run_mod_handler()
Handle modifiers
Smarty::_smarty_cache_attrs()
get or set an array of cached attributes for function that is
Smarty::_smarty_include()
called for included templates
Smarty::_trigger_fatal_error()
trigger Smarty plugin error
Smarty::_unlink()
unlink a file, possibly using expiration time

[ Top ]
Method Summary
Smarty_Compiler   Smarty_Compiler()   The class constructor.
void   _add_plugin()   add plugin
void   _compile_arg_list()  
boolean   _compile_block_tag()   compile block function tag
string   _compile_capture_tag()   Compile {capture} .. {/capture} tags
boolean   _compile_compiler_tag()   compile the custom compiler tag
string   _compile_custom_tag()   compile custom function tag
true   _compile_file()   compile a resource
string   _compile_foreach_start()   Compile {foreach ...} tag.
string   _compile_if_tag()   Compile {if ...} tag
string   _compile_include_php_tag()   Compile {include ...} tag
string   _compile_include_tag()   Compile {include ...} tag
string   _compile_insert_tag()   Compile {insert ...} tag
string   _compile_plugin_call()   compiles call to plugin of type $type with name $name
string   _compile_registered_object_tag()   compile a registered object tag
string   _compile_section_start()   Compile {section ...} tag
string   _compile_smarty_ref()   Compiles references of type $smarty.foo
string   _compile_tag()   Compile a template tag
string   _expand_quoted_text()   expand quoted text with embedded variables
void   _load_filters()   load pre- and post-filters
array   _parse_attrs()   Parse attribute string
void   _parse_conf_var()   parse configuration variable expression into PHP code
array   _parse_is_expr()   Parse is expression
void   _parse_modifiers()   parse modifier chain into PHP code
string   _parse_parenth_args()   parse arguments in function call parenthesis
string   _parse_section_prop()   parse section property expression into PHP code
string   _parse_var()   parse variable expression into PHP code
void   _parse_vars_props()   compile multiple variables and section properties tokens into PHP code
string   _parse_var_props()   compile single variable and section properties token into PHP code
string   _pop_cacheable_state()   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_tag()   pop closing tag-name
string   _push_cacheable_state()   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.
void   _push_tag()   push opening tag-name, file-name and line-number on the tag-stack
string   _quote_replace()   Quote subpattern references
void   _syntax_error()   display Smarty syntax error

[ Top ]
Methods
Constructor Smarty_Compiler  [line 81]

  Smarty_Compiler Smarty_Compiler( )

The class constructor.



[ Top ]
_add_plugin  [line 1946]

  void _add_plugin( string $type, string $name, [boolean? $delayed_loading = null]  )

add plugin

Parameters:
string   $type: 
string   $name: 
boolean?   $delayed_loading: 


[ Top ]
_compile_arg_list  [line 1396]

  void _compile_arg_list( mixed $type, mixed $name, mixed $attrs, mixed &$cache_code  )



[ Top ]
_compile_block_tag  [line 663]

  boolean _compile_block_tag( string $tag_command, string $tag_args, string $tag_modifier, string &$output  )

compile block function tag

sets $output to compiled block function tag

Parameters:
string   $tag_command: 
string   $tag_args: 
string   $tag_modifier: 
string   $output: 


[ Top ]
_compile_capture_tag  [line 1202]

  string _compile_capture_tag( boolean $start, [string $tag_args = '']  )

Compile {capture} .. {/capture} tags

Parameters:
boolean   $start:  true if this is the {capture} tag
string   $tag_args: 


[ Top ]
_compile_compiler_tag  [line 594]

  boolean _compile_compiler_tag( string $tag_command, string $tag_args, string &$output  )

compile the custom compiler tag

sets $output to the compiled custom compiler tag

Parameters:
string   $tag_command: 
string   $tag_args: 
string   $output: 


[ Top ]
_compile_custom_tag  [line 753]

  string _compile_custom_tag( string $tag_command, string $tag_args, string $tag_modifier, mixed &$output  )

compile custom function tag

Parameters:
string   $tag_command: 
string   $tag_args: 
string   $tag_modifier: 


[ Top ]
_compile_file  [line 225]

  true _compile_file( string $resource_name, string $source_content, string &$compiled_content  )

compile a resource

sets $compiled_content to the compiled source

Parameters:
string   $resource_name: 
string   $source_content: 
string   $compiled_content: 


[ Top ]
_compile_foreach_start  [line 1141]

  string _compile_foreach_start( string $tag_args  )

Compile {foreach ...} tag.

Parameters:
string   $tag_args: 


[ Top ]
_compile_if_tag  [line 1237]

  string _compile_if_tag( string $tag_args, [boolean $elseif = false]  )

Compile {if ...} tag

Parameters:
string   $tag_args: 
boolean   $elseif:  if true, uses elseif instead of if


[ Top ]
_compile_include_php_tag  [line 1004]

  string _compile_include_php_tag( string $tag_args  )

Compile {include ...} tag

Parameters:
string   $tag_args: 


[ Top ]
_compile_include_tag  [line 951]

  string _compile_include_tag( string $tag_args  )

Compile {include ...} tag

Parameters:
string   $tag_args: 


[ Top ]
_compile_insert_tag  [line 917]

  string _compile_insert_tag( string $tag_args  )

Compile {insert ...} tag

Parameters:
string   $tag_args: 


[ Top ]
_compile_plugin_call  [line 2121]

  string _compile_plugin_call( string $type, string $name  )

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

Parameters:
string   $type: 
string   $name: 


[ Top ]
_compile_registered_object_tag  [line 825]

  string _compile_registered_object_tag( string $tag_command, array $attrs, string $tag_modifier  )

compile a registered object tag

Parameters:
string   $tag_command: 
array   $attrs: 
string   $tag_modifier: 


[ Top ]
_compile_section_start  [line 1036]

  string _compile_section_start( string $tag_args  )

Compile {section ...} tag

Parameters:
string   $tag_args: 


[ Top ]
_compile_smarty_ref  [line 1965]

  string _compile_smarty_ref( string &$indexes  )

Compiles references of type $smarty.foo

Parameters:
string   $indexes: 


[ Top ]
_compile_tag  [line 425]

  string _compile_tag( string $template_tag  )

Compile a template tag

Parameters:
string   $template_tag: 


[ Top ]
_expand_quoted_text  [line 1653]

  string _expand_quoted_text( string $var_expr  )

expand quoted text with embedded variables

Parameters:
string   $var_expr: 


[ Top ]
_load_filters  [line 2145]

  void _load_filters( )

load pre- and post-filters



[ Top ]
_parse_attrs  [line 1497]

  array _parse_attrs( string $tag_args  )

Parse attribute string

Parameters:
string   $tag_args: 


[ Top ]
_parse_conf_var  [line 1831]

  void _parse_conf_var( string $conf_var_expr  )

parse configuration variable expression into PHP code

Parameters:
string   $conf_var_expr: 


[ Top ]
_parse_is_expr  [line 1436]

  array _parse_is_expr( string $is_arg, array $tokens  )

Parse is expression

Parameters:
string   $is_arg: 
array   $tokens: 


[ Top ]
_parse_modifiers  [line 1877]

  void _parse_modifiers( string &$output, string $modifier_string  )

parse modifier chain into PHP code

sets $output to parsed modified chain

Parameters:
string   $output: 
string   $modifier_string: 


[ Top ]
_parse_parenth_args  [line 1814]

  string _parse_parenth_args( string $parenth_args  )

parse arguments in function call parenthesis

Parameters:
string   $parenth_args: 


[ Top ]
_parse_section_prop  [line 1852]

  string _parse_section_prop( string $section_prop_expr  )

parse section property expression into PHP code

Parameters:
string   $section_prop_expr: 


[ Top ]
_parse_var  [line 1679]

  string _parse_var( string $var_expr, string $output  )

parse variable expression into PHP code

Parameters:
string   $var_expr: 
string   $output: 


[ Top ]
_parse_vars_props  [line 1578]

  void _parse_vars_props( array &$tokens  )

compile multiple variables and section properties tokens into PHP code

Parameters:
array   $tokens: 


[ Top ]
_parse_var_props  [line 1593]

  string _parse_var_props( string $val, string $tag_attrs  )

compile single variable and section properties token into PHP code

Parameters:
string   $val: 
string   $tag_attrs: 


[ Top ]
_pop_cacheable_state  [line 2219]

  string _pop_cacheable_state( mixed $type, mixed $name  )

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.



[ Top ]
_pop_tag  [line 2244]

  string _pop_tag( string $close_tag  )

pop closing tag-name

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

Parameters:
string   $close_tag:  the closing tag's name

API Tags:
Return:  the opening tag's name


[ Top ]
_push_cacheable_state  [line 2201]

  string _push_cacheable_state( mixed $type, mixed $name  )

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.



[ Top ]
_push_tag  [line 2233]

  void _push_tag( string $open_tag  )

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

Parameters:
string   $open_tag:  the opening tag's name


[ Top ]
_quote_replace  [line 2176]

  string _quote_replace( string $string  )

Quote subpattern references

Parameters:
string   $string: 


[ Top ]
_syntax_error  [line 2189]

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

display Smarty syntax error

Parameters:
string   $error_msg: 
integer   $error_type: 
string   $file: 
integer   $line: 


[ Top ]