function testDisplay() { $handler = new XTemplater(); $handler->assign('name', 'Hajime'); $handler->assign('place', array('japan', 'mongolia')); ob_start(); $handler->display("file://{$this->dirname}/test.display.tpl"); $data = ob_get_clean(); $this->assertEquals('Name: HajimePlace: japanPlace: mongolia', trim($data)); }
public function __construct($tpl) { parent::__construct(); $this->registerCompilerHandler("snippet", array($this, 'snippet')); $this->tpl = $tpl; }