Exemplo n.º 1
0
	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);
	}
Exemplo n.º 2
0
	public function addMacro($name, $begin, $end = NULL, $attr = NULL)
	{
		$this->macros[$name] = array($begin, $end, $attr);
		$this->compiler->addMacro($name, $this);
		return $this;
	}