Summary
- abstract
- File
- Package hierarchy IO\Template
- Class hierarchy \AbstractTemplate
- Implements \Template
This class is a default implementation of the Template interface using a TemplateLoader, a TemplateData and a TemplateParser.
This class is a default implementation of the Template interface using a TemplateLoader, a TemplateData and a TemplateParser.
__construct(\TemplateLoader $loader, \TemplateRenderer $renderer, \TemplateData $data)
Builds an AbstractTemplate from the different services it has to use.
| \TemplateLoader | $loader | The loader |
| \TemplateRenderer | $renderer | The renderer |
| \TemplateData | $data | The data |
| None found |
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.
| None found |
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.
| None found |
put( $key, $value)
Assigns the value <code>$code</code> to the template variable of name <code>$key</code>
| $key | the template parameter name |
|
| $value | the template parameter value |
| None found |
put_all(array $vars)
Assigns template variables. It could be simple variables, loop or subtemplates.
| array | $vars | A map key => value where |
| None found |
assign_vars(array $array_vars)
| array | $array_vars | A map var_name => var_value. Generally, var_name is written in caps characters. |
| None found |
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.
| string | $block_name | Block name. |
| array | $array_vars | A map var_name => var_value. Generally, var_name is written in caps characters. |
| array | $subtemplates | A list |
| None found |
add_subtemplate(string $identifier, \Template $template)
| string | $identifier | the identifier |
| \Template | $template | the template to include (variables must be set in this template) |
| None found |
__clone()
{@inheritdoc}
| None found |
render()
{@inheritdoc}
| None found |
display( $reorder_js = false)
Displays the template.
| $reorder_js |
| None found |
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
| array | $lang | the language map |
| None found |
set_data(\TemplateData $data)
Inject data into the template. This is for internal use only.
| \TemplateData | $data |
| None found |
get_data() : \TemplateData
Returns the template data
| None found |
get_pictures_data_path() : String
Returns the pictures data path
| None found |
set_loader(\TemplateLoader $loader)
| \TemplateLoader | $loader |
| None found |
set_renderer(\TemplateRenderer $renderer)
| \TemplateRenderer | $renderer |
| None found |
render_with_reordered_js()
{@inheritdoc}
| None found |