public function __construct() { $this->parser = new Parser(); $this->compiler = new LatteCompiler(); $this->compiler->defaultContentType = LatteCompiler::CONTENT_XHTML; CoreMacros::install($this->compiler); $this->compiler->addMacro('cache', new CacheMacro($this->compiler)); UIMacros::install($this->compiler); FormMacros::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; }