Esempio n. 1
0
 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);
 }
Esempio 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;
 }