public function __construct() { $this->parser = new NParser; $this->compiler = new NLatteCompiler; $this->compiler->defaultContentType = NLatteCompiler::CONTENT_XHTML; NCoreMacros::install($this->compiler); $this->compiler->addMacro('cache', new NCacheMacro($this->compiler)); NUIMacros::install($this->compiler); NFormMacros::install($this->compiler); }
public function addMacro($name, $begin, $end = NULL, $attr = NULL) { $this->macros[$name] = array($begin, $end, $attr); $this->compiler->addMacro($name, $this); return $this; }