* @package patTemplate * @subpackage Examples * @link http://www.php-tools.net * @see patTemplate::addGlobalVar() * @see patTemplate::addGlobalVars() */ /** * Main examples prepend file, needed *only* for the examples framework! */ include_once 'patExampleGen/prepend.php'; // EXAMPLE START ------------------------------------------------------ /** * patErrorManager class */ require_once $neededFiles['patErrorManager']; /** * patTemplate */ require_once $neededFiles['patTemplate']; /** * compiler */ require_once '../patTemplate/Compiler.php'; $tmpl = &new patTemplate_Compiler(); $tmpl->setRoot( 'templates' ); $tmpl->setOption( 'compileFolder', 'compiledTemplates' ); $tmpl->readTemplatesFromInput( 'example_compiler_display.tmpl' ); $tmpl->compile( 'example1.php' ); $tmpl->addGlobalVar( 'GLOBAL', 'I\'m global.' ); $tmpl->addVar( 'template2', 'schst', array( 'one', 'two', 'repeat it.' ) ); $tmpl->addVar( 'template1', 'argh', array( 'one', 'two', 'repeat it.' ) ); $tmpl->addVars( 'template1', array( 'foo' => 'This is a string', 'bar' => 453 ) ); /** * standard template and dependencies */ echo '