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