Class

AbstractTemplate

Abstract Package: IO\Template Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Loic ROUCHON horn@phpboost.com Version: PHPBoost 5.2 - last update: 2016 11 14 Since: PHPBoost 3.0 - 2009 06 18 Contributor: Regis VIARRE crowkait@phpboost.com Contributor: Julien BRISWALTER j1.seth@phpboost.com Contributor: Arnaud GENET elenwii@phpboost.com Contributor: mipel mipel@phpboost.com Located at: io/template/AbstractTemplate.class.php

This class is a default implementation of the Template interface using a TemplateLoader, a TemplateData and a TemplateParser.

AbstractTemplate implements Template
Direct known subclasses
FileTemplate, StringTemplate
Methods summary
public
# __construct( TemplateLoader $loader, TemplateRenderer $renderer, TemplateData $data )

Builds an AbstractTemplate from the different services it has to use.

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.

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.

public
# put( $key, $value )

Assigns the value

$code

to the template variable of name

$key
public
# put_all( array $vars )

Assigns template variables. It could be simple variables, loop or subtemplates.

public
# assign_vars( array $array_vars )
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.

public
# add_subtemplate( string $identifier, Template $template )
public
# __clone( )
public string
# render( )

Returns a string representation of the view.

public
# display( $reorder_js = false )

Displays the template.

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

public
# set_data( TemplateData $data )

Inject data into the template. This is for internal use only.

public TemplateData
# get_data( )

Returns the template data

public String
# get_pictures_data_path( )

Returns the pictures data path

Properties summary
protected TemplateLoader $loader
#
protected TemplateRenderer $renderer
#
protected TemplateData $data
#