Re: Template Sigma Help
| From: | Ian Warner | Date: | Sat, 30 Sep 2006 17:07:53 +0000 |
| Subject: | Re: Template Sigma Help | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25320@lists.php.net to get a copy of this message | ||
Alexey Borzov wrote:
Hi, Ian Warner wrote:Thank you, I did read the docs and look through the examples, sometimes it is just difficult to know what to use, I read through all the functions even touchBlock - touchBlock() -- Preserves the block even if empty blocks should be removed. Made little sense to me so assumed it was not something I need to parse the block, without a placeholder. Thanks again working nice now IanOk so took Betrands advice (thanks) and started using the Sigma template: I created the following as a test: wrapper.tpl <!-- BEGIN tr --> <div id="wrapper">12345</div> <!-- END tr --> <p class="skipLink"> <a href="#main" accesskey="2">Skip to main content</a> </p> </div> // Load template file. $tpl->loadTemplatefile('wrapper.tpl'); $tpl->setCurrentBlock('tr'); $tpl->parse('tr'); $page->addBodyContent($tpl->get()); Now from what I gather this should just print out <div id="wrapper">12345</div> - but on the contrary it is printing outYou *really* should consider reading the docs and running the examples. To get the output you desire you should do something along the lines of $tpl->loadTemplatefile('wrapper.tpl'); $tpl->touchBlock('tr'); // since there are no placeholders in block... $tpl->parse('tr'); $tpl->get('tr'); Alexey