Simple PHP template class.
Example
Template variables:
{var}
- single variable{loop items} {name} {end loop}
- loop for items array{%index%}
- index of item in items loop
- Include template class:
include 'template.php';
- Create an object:
$template = new Template();
- Set template variables, single:
$template->assign( 'my_var', 'test' );
- Set template variables, loops:
$template->assign( 'items', array( array( 'name' => 'First' ), array( 'name' => 'Second' ) ) );
- Parse template:
$template->parse( 'tpl.html' );