Пример #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);
 }
Пример #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;
 }
Пример #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;
 }