Methods summary
public
|
#
__construct( array $options = array() )
Initialize new SmartyBC object
Initialize new SmartyBC object
Parameters
- $options
- options to set during initialization, e.g. array( 'forceCompile' => false )
Overrides
|
public
|
#
assign_by_ref( string $tpl_var, mixed & $value )
wrapper for assign_by_ref
wrapper for assign_by_ref
Parameters
- $tpl_var
- the template variable name
- $value
- $value the referenced value to assign
|
public
|
#
append_by_ref( string $tpl_var, mixed & $value, boolean $merge = false )
wrapper for append_by_ref
wrapper for append_by_ref
Parameters
- $tpl_var
- the template variable name
- $value
- $value the referenced value to append
- $merge
- flag if array elements shall be merged
|
public
|
#
clear_assign( string $tpl_var )
clear the given assigned template variable.
clear the given assigned template variable.
Parameters
- $tpl_var
- the template variable to clear
|
public
|
#
register_function( string $function, string $function_impl, boolean $cacheable = true, mixed $cache_attrs = null )
Registers custom function to be used in templates
Registers custom function to be used in templates
Parameters
- $function
- the name of the template function
- $function_impl
- the name of the PHP function to register
- $cacheable
- $cache_attrs
|
public
|
#
unregister_function( string $function )
Unregisters custom function
Unregisters custom function
Parameters
- $function
- name of template function
|
public
|
#
register_object( string $object, object $object_impl, array $allowed = array(), boolean $smarty_args = true, array $block_methods = array() )
Registers object to be used in templates
Registers object to be used in templates
Parameters
- $object
- name of template object
- $object_impl
- the referenced PHP object to register
- $allowed
- list of allowed methods (empty = all)
- $smarty_args
- smarty argument format, else traditional
- $block_methods
- list of methods that are block format
Throws
|
public
|
#
unregister_object( string $object )
Unregisters object
Parameters
- $object
- name of template object
|
public
|
#
register_block( string $block, string $block_impl, boolean $cacheable = true, mixed $cache_attrs = null )
Registers block function to be used in templates
Registers block function to be used in templates
Parameters
- $block
- name of template block
- $block_impl
- PHP function to register
- $cacheable
- $cache_attrs
|
public
|
#
unregister_block( string $block )
Unregisters block function
Unregisters block function
Parameters
- $block
- name of template function
|
public
|
#
register_compiler_function( string $function, string $function_impl, boolean $cacheable = true )
Registers compiler function
Registers compiler function
Parameters
- $function
- name of template function
- $function_impl
- name of PHP function to register
- $cacheable
|
public
|
#
unregister_compiler_function( string $function )
Unregisters compiler function
Unregisters compiler function
Parameters
- $function
- name of template function
|
public
|
#
register_modifier( string $modifier, string $modifier_impl )
Registers modifier to be used in templates
Registers modifier to be used in templates
Parameters
- $modifier
- name of template modifier
- $modifier_impl
- name of PHP function to register
|
public
|
#
unregister_modifier( string $modifier )
Unregisters modifier
Parameters
- $modifier
- name of template modifier
|
public
|
#
register_resource( string $type, array $functions )
Registers a resource to fetch a template
Registers a resource to fetch a template
Parameters
- $type
- name of resource
- $functions
- array of functions to handle resource
|
public
|
|
public
|
#
register_prefilter( callable $function )
Registers a prefilter function to apply
to a template before compiling
Registers a prefilter function to apply
to a template before compiling
Parameters
|
public
|
#
unregister_prefilter( callable $function )
Unregisters a prefilter function
Unregisters a prefilter function
Parameters
|
public
|
#
register_postfilter( callable $function )
Registers a postfilter function to apply
to a compiled template after compilation
Registers a postfilter function to apply
to a compiled template after compilation
Parameters
|
public
|
#
unregister_postfilter( callable $function )
Unregisters a postfilter function
Unregisters a postfilter function
Parameters
|
public
|
#
register_outputfilter( callable $function )
Registers an output filter function to apply
to a template output
Registers an output filter function to apply
to a template output
Parameters
|
public
|
#
unregister_outputfilter( callable $function )
Unregisters an outputfilter function
Unregisters an outputfilter function
Parameters
|
public
|
#
load_filter( string $type, string $name )
load a filter of specified type and name
load a filter of specified type and name
Parameters
- $type
- filter type
- $name
- filter name
|
public
boolean
|
#
clear_cache( string $tpl_file = null, string $cache_id = null, string $compile_id = null, string $exp_time = null )
clear cached content for the given template and cache id
clear cached content for the given template and cache id
Parameters
- $tpl_file
- name of template file
- $cache_id
- name of cache_id
- $compile_id
- name of compile_id
- $exp_time
- expiration time
Returns
boolean
|
public
boolean
|
#
clear_all_cache( string $exp_time = null )
clear the entire contents of cache (all templates)
clear the entire contents of cache (all templates)
Parameters
Returns
boolean
|
public
boolean
|
#
is_cached( string $tpl_file, string $cache_id = null, string $compile_id = null )
test to see if valid cache exists for this template
test to see if valid cache exists for this template
Parameters
- $tpl_file
- name of template file
- $cache_id
- $compile_id
Returns
boolean
|
public
|
#
clear_all_assign( )
clear all the assigned template variables.
clear all the assigned template variables.
|
public
boolean
|
#
clear_compiled_tpl( string $tpl_file = null, string $compile_id = null, string $exp_time = null )
clears compiled version of specified template resource,
or all compiled template files if one is not specified.
This function is for advanced use only, not normally needed.
clears compiled version of specified template resource,
or all compiled template files if one is not specified.
This function is for advanced use only, not normally needed.
Parameters
- $tpl_file
- $compile_id
- $exp_time
Returns
boolean results of smarty_core_rm_auto()
|
public
boolean
|
#
template_exists( string $tpl_file )
Checks whether requested template exists.
Checks whether requested template exists.
Parameters
Returns
boolean
|
public
array
|
#
get_template_vars( string $name = null )
Returns an array containing template variables
Returns an array containing template variables
Parameters
Returns
array
|
public
array
|
#
get_config_vars( string $name = null )
Returns an array containing config variables
Returns an array containing config variables
Parameters
Returns
array
|
public
|
#
config_load( string $file, string $section = null, string $scope = 'global' )
load configuration values
load configuration values
Parameters
|
public
object
|
#
get_registered_object( string $name )
return a reference to a registered object
return a reference to a registered object
Parameters
Returns
object
|
public
|
#
clear_config( string $var = null )
clear configuration values
clear configuration values
Parameters
|
public
|
#
trigger_error( string $error_msg, integer $error_type = E_USER_WARNING )
trigger Smarty error
Parameters
|