public function __construct() { $this->parser = new Parser(); $this->compiler = new Compiler(); $this->compiler->defaultContentType = Compiler::CONTENT_XHTML; CoreMacros::install($this->compiler); $this->compiler->addMacro('cache', new GlobalCacheMacro($this->compiler)); FormMacros::install($this->compiler); }
public function addMacro($name, $begin, $end = NULL, $attr = NULL) { foreach (array($begin, $end, $attr) as $arg) { if ($arg && !is_string($arg)) { Nette\Utils\Callback::check($arg); } } $this->macros[$name] = array($begin, $end, $attr); $this->compiler->addMacro($name, $this); return $this; }
public function addMacro($name, $begin, $end = NULL, $attr = NULL) { $this->macros[$name] = array($begin, $end, $attr); $this->compiler->addMacro($name, $this); return $this; }