/** * Invokes filter. * @param string * @return string */ public function __invoke($s) { $this->parser->context = Parser::CONTEXT_TEXT; $this->parser->escape = 'Nette\\Templating\\DefaultHelpers::escapeHtml|'; $this->parser->setDelimiters('\\{(?![\\s\'"{}*])', '\\}'); return $this->parser->parse($s); }
/** * Compilation time templating filters * * @param Nette\Templating\Template * @return void */ public final function templatePrepareFilters($template) { // We cannot use Nette\Latte\Engine class directly, because we need our SystemMacros // to be declared befor UIMacros // $this->getPresenter()->getContext()->nette->createLatte() $parser = new Nette\Latte\Parser(); $compiler = new Nette\Latte\Compiler(); $compiler->defaultContentType = Nette\Latte\Compiler::CONTENT_XHTML; $this->lattePrepareMacros($compiler, $template); $template->registerFilter(function ($s) use($compiler, $parser) { return $compiler->compile($parser->parse($s)); }); }
/** * Invokes filter. * * @param string * * @return string */ public function __invoke($s) { return $this->compiler->compile($this->parser->parse($s)); }
/** * Invokes filter. * @param string * @return string */ public function __invoke($s) { $this->parser->context = array(Parser::CONTEXT_TEXT); $this->parser->setDelimiters('\\{(?![\\s\'"{}])', '\\}'); return $this->parser->parse($s); }