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); }
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); }
/** * 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); }
/** * {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); }