Package IO\Template\data

Package IO\Template\data

Classes summary
DefaultTemplateData This class is a default implementation of the TemplateData interface.
Interfaces summary
TemplateData

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.