Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.1

Bug #20571 ITX function call in block
Submitted: 2015-07-14 13:08 UTC
From: petermacko Assigned:
Status: Open Package: HTML_Template_IT (version 1.3.0)
PHP Version: 5.6.3 OS: Windows (IIS)
Roadmaps: (Not assigned)    
Subscription  


 [2015-07-14 13:08 UTC] petermacko (Peter Macko)
Description: ------------ Im using ITX template HTML maker. I would like to use functions in html templates implemented in ITX classfile. But my problem is that function work only in main template. But I would like to use function calls in blockfile calls. When i add function to block file which is included in main template function is not called and in content is still function name and parameter. This is my code: $this->tpl = new HTML_Template_ITX(); $this->tpl->loadTemplatefile("index.tpl.php", true, true); $this->tpl->addBlockfile("CONTENT", "CONTENT", "doch_kalendar.tpl.php"); $this->tpl->setCallbackFunction('t', 't'); $this->tpl->performCallback(); in the doch_kalendar.tpl.php i have this statement: func_t("previousperiod") <b>some html code</b> If i add this statement: func_t("previousperiod") to index.tpl.php function in this template is called. Test script: --------------- $this->tpl = new HTML_Template_ITX(); $this->tpl->loadTemplatefile("index.tpl.php", true, true); $this->tpl->addBlockfile("CONTENT", "CONTENT", "doch_kalendar.tpl.php"); $this->tpl->setCallbackFunction('t', 't'); $this->tpl->performCallback(); Expected result: ---------------- .....index.tpl.php content before...... Previous period <b>some html code</b> ....index.tpl.php content after..... Actual result: -------------- .....index.tpl.php content before...... func_t("previousperiod") <b>some html code</b> ....index.tpl.php content after.....

Comments