Esempio n. 1
0
 public function __construct()
 {
     $this->parser = new Parser();
     Macros\CoreMacros::install($this->parser);
     $this->parser->addMacro('cache', new Macros\CacheMacro($this->parser));
     Macros\UIMacros::install($this->parser);
     Macros\FormMacros::install($this->parser);
 }
Esempio n. 2
0
 public function __construct()
 {
     $this->parser = new Parser();
     $this->compiler = new Compiler();
     $this->compiler->defaultContentType = Compiler::CONTENT_XHTML;
     Macros\CoreMacros::install($this->compiler);
     $this->compiler->addMacro('cache', new Macros\CacheMacro($this->compiler));
     Macros\UIMacros::install($this->compiler);
     Macros\FormMacros::install($this->compiler);
 }
Esempio n. 3
0
 /**
  * Finishes template parsing.
  * @return array(prolog, epilog)
  */
 public function finalize()
 {
     list($prolog, $epilog) = parent::finalize();
     // TODO: Some escaping
     if (self::$autoExtend != NULL) {
         $escaped = '"' . self::$autoExtend . '"';
         $prolog = preg_replace('/\\$_l->extends\\s*=[^\\?]+\\?[^\\:]+\\:[^;]+;/', '$_l->extends = ' . $escaped . ';', $prolog);
         self::$autoExtend = NULL;
     }
     return array($prolog, $epilog);
 }
Esempio n. 4
0
 /**
  * {link destination [,] [params]}
  * {plink destination [,] [params]}
  * n:href="destination [,] [params]"
  * n:link
  */
 public function macroLink(MacroNode $node, PhpWriter $writer)
 {
     if ($node->args == '') {
         if ($node->htmlNode) {
             $node->attrCode = $writer->write(' href="<?php echo $_macroIfLinkExistslink; ?>"');
             return;
         }
         return $writer->write('echo $_macroIfLinkExistslink');
     }
     return parent::macroLink($node, $writer);
 }