public function generate(PHPTAL_Dom_Tree $tree) { $treeGen = new PHPTAL_Php_Tree($this->_writer, $tree); $this->_writer->doComment('Generated by PHPTAL from ' . $this->_sourceFile); $this->_writer->doFunction($this->_functionName, '$tpl, $ctx'); $this->_writer->setFunctionPrefix($this->_functionName . "_"); $this->_writer->doSetVar('$glb', '$tpl->getGlobalContext()'); $treeGen->generate(); $this->_writer->doEnd(); }
public function generate(PHPTAL_Dom_Tree $tree) { $treeGen = new PHPTAL_Php_Tree($this->_writer, $tree); $this->_writer->doComment("\n*** DO NOT EDIT THIS FILE ***\n\nGenerated by PHPTAL from " . $this->_sourceFile . " (edit that file instead)"); $this->_writer->doFunction($this->_functionName, '$tpl, $ctx'); $this->_writer->setFunctionPrefix($this->_functionName . "_"); $this->_writer->doSetVar('$_thistpl', '$tpl'); $this->_writer->doSetVar('$glb', '$tpl->getGlobalContext()'); $this->_writer->doSetVar('$_translator', '$tpl->getTranslator()'); $treeGen->generate(); $this->_writer->doEnd(); }
public function generateContent($realContent = false) { if ($this->isEmptyNode()) { return; } if (!$realContent && count($this->contentAttributes) > 0) { foreach ($this->contentAttributes as $att) { $att->start(); $att->end(); } return; } parent::generate(); }