HTML/IT - bug or strange behaviour
| From: | Wolfram Kriesing | Date: | Fri, 28 Sep 2001 12:51:22 +0000 |
| Subject: | HTML/IT - bug or strange behaviour | ||
| Groups: | php.general php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-2093@lists.php.net to get a copy of this message | ||
in class HTML - IntegratedTemplate
blocks are processed in the order they were found when reading the template
file, not in the order the setVariable or parseCurrentBlock methods were
called, which has the following effect
template:
<!-- BEGIN superBlock -->
<!-- BEGIN block1 -->
{value1}
<!-- END block1 -->
<!-- BEGIN block2 -->
<font color="red">{value2}</font>
<!-- END block2 -->
<!-- END superBlock -->
code:
// should show block 2 first
$tpl->setCurrentBlock("block2");
$tpl->setVariable("value2",$myValue2);
$tpl->parseCurrentBlock();
// block 1 second
$tpl->setCurrentBlock("block1");
$tpl->setVariable("value1",$myValue1);
$tpl->parseCurrentBlock();
but the result is that block 1 is shown before block2.
am i using the IT-class wrong or is that a behaviour as expected?
i am showing either block1 or block2 as columns of a table, which means that
an order "block1 block2 block1 block2" is NOT possible, since internally the
order as parsed from the template is used, which is: first all block1's and
second all block2's
the class IntegratedTemplate should be renamed to meet the PEAR convention
to "HTML_IT", or not? it was irritating me some times
Wolfram Kriesing