Methods summary
public
|
#
__construct( TemplateLoader $loader, TemplateRenderer $renderer, TemplateData $data )
Builds an AbstractTemplate from the different services it has to use.
Builds an AbstractTemplate from the different services it has to use.
Parameters
- $loader
- The loader
- $renderer
- The renderer
- $data
- The data
|
public
|
#
enable_strict_mode( )
Enables the strict mode. If a variable that does not exist in the object is requested,
then an exception will be raised.
Enables the strict mode. If a variable that does not exist in the object is requested, then an exception will be raised.
Implementation of
|
public
|
#
disable_strict_mode( )
Disables the strict mode. If a variable that does not exist in the object is requested,
then an empty value will be returned.
Disables the strict mode. If a variable that does not exist in the object is requested, then an empty value will be returned.
Implementation of
|
public
|
#
put( $key, $value )
Assigns the value
$code
to the template variable of name
$key
Assigns the value
$code
to the template variable of name
$key
Parameters
- $key
- template parameter name
- $value
- template parameter value
Implementation of
|
public
|
#
put_all( array $vars )
Assigns template variables. It could be simple variables, loop or subtemplates.
Assigns template variables. It could be simple variables, loop or subtemplates.
Parameters
- $vars
A map key => value where
$value
will be assigned to the template variable of name
$key
Implementation of
|
public
|
#
assign_vars( array $array_vars )
Parameters
- $array_vars
- A map var_name => var_value. Generally, var_name is written in caps characters.
Implementation of
|
public
|
#
assign_block_vars( string $block_name, array $array_vars, array $subtemplates = array() )
Assigns a template block. A block represents a loop and has a name which be used in your template file to indicate which loop you want to browse.
To know what syntax to use to browse a loop, see the class description, there are examples.
Assigns a template block. A block represents a loop and has a name which be used in your template file to indicate which loop you want to browse.
To know what syntax to use to browse a loop, see the class description, there are examples.
Parameters
- $block_name
- Block name.
- $array_vars
- A map var_name => var_value. Generally, var_name is written in caps characters.
- $subtemplates
- A list
Implementation of
|
public
|
#
add_subtemplate( string $identifier, Template $template )
Parameters
- $identifier
- the identifier
- $template
- the template to include (variables must be set in this template)
Implementation of
|
public
|
|
public
string
|
#
render( )
Returns a string representation of the view.
Returns a string representation of the view.
Returns
string a string representation of the view
Throws
Implementation of
|
public
|
#
display( $reorder_js = false )
Displays the template.
Implementation of
|
public
|
#
add_lang( array $lang )
Adds a lang map to the template map list in which template variables beginning by L_ will be searched for of not already registered
Adds a lang map to the template map list in which template variables beginning by L_ will be searched for of not already registered
Parameters
Implementation of
|
public
|
#
set_data( TemplateData $data )
Inject data into the template. This is for internal use only.
Inject data into the template. This is for internal use only.
Parameters
- $data
- data to inject into the template
Implementation of
|
public
TemplateData
|
#
get_data( )
Returns the template data
Returns the template data
Returns
Implementation of
|
public
String
|
#
get_pictures_data_path( )
Returns the pictures data path
Returns the pictures data path
Returns
String
Implementation of
|