TemplateTemplate Management for PHP5
The Template engine allows to keep the HTML code in some external files which are completely free of PHP code. This way, it's possible keep logical programmin (PHP code) away from visual structure (HTML or XML, CSS, etc)
If you are familiar with PHP template concept, this class includes these features: auto-detect blocks, auto-clean children blocks, warning when user call for a non-existent block, warning when a mal-formed block is detected, warning when user sets a non existant variable, and other minor features.
Read the tutorial for more details, error messages, etc.
Constructor __construct
Creates a new template, using $filename as main file.
When the parameter $accurate is true, blocks will be replaced perfectly (in the parse time), e.g., removing all \t (tab) characters, making the final document an accurate version. This will impact (a lot) the performance. Usefull for files using the <pre> or <code> tags.
addFile
Put the content of $filename in the template variable identified by $varname
clearVar
Clear the value of a variable.
parseBlock
Show a block.
This method must be called when a block must be showed. Otherwise, the block will not appear in the resultant content.
If the parameter $append is true, the block content will be appended with the previous content.
getContent
Returns the final content.
If you want to see the content in the screen, use Template::show().
show
Print the final content.
Documentation generated on Tue, 26 Feb 2008 07:38:54 -0300 by phpDocumentor 1.3.0RC3