Interface

TemplateData

Package: io Author: Benoit Sautel <ben.popeye@phpboost.com> Desc: This interface describes data which are assigned to a template. There are two types of data:
  • Variables: there are string that are directly displayed
  • Templates: you can embed a template in another one. When a subtemplate is displayed, it's parsed using its own data and the result is inserted where the subtemplate is embedded.
A template contains global variables which are available in the whole template and local variable which are only defined into a loop. To define a loop, you just have to use assign_block_vars with the same loop identifier for each loop iteration. Loops can be nested and embed both variables and subtemplates.
Located at io/template/data/TemplateData.class.php

Direct known implementers

DefaultTemplateData
Methods summary
public
# enable_strict_mode( )
public
# disable_strict_mode( )
public
# auto_load_frequent_vars( )
public
# put( mixed $key, mixed $value )
public
# put_all( array $vars )
public
# assign_block_vars( string $block_name, array $array_vars, array $subtemplates = array() )
public mixed[]
# get_block( string $blockname )
public mixed[]
# get_block_from_list( string $blockname, mixed[] $parent_block )
public boolean
# is_true( string $value )
public string
# get( string $varname )
public string
# get_from_list( string $varname, mixed[] & $list )
public
# bind_vars( TemplateData $data )