|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
babai7395 Smarty n00b
Joined: 20 Feb 2013 Posts: 2
|
Posted: Wed Feb 20, 2013 6:44 pm Post subject: Smarty 3.1.8: post filter applies for every {block} + 1 |
|
|
Good day.
Post filter is called exactly count of inherited {block}'s +1 in child template.
Example root.tpl:
Code: | {block name="css"}111{/block}
{block name="css2"}222{/block} |
child.tpl:
Code: | {extends file="root.tpl"}
{block name="css"}333{/block}
{block name="css2"}444{/block} |
post filter:
Code: | function postFilter($compiled, $template)
{
echo 'in postfilter; ';
return '<?php echo "in postfilter;" ?>' . $compiled;
}
$smarty->registerFilter(
'post',
'postFilter'
);
$smarty->display('child.tpl');
|
If in child.tpl we inherit 2 blocks, postFilter will be called 3 times. If we inherit only 1 block, postfilter will be called 2 times.
Expected behavior: postFilter is called only 1 time on compiled template before saving it to filesystem, no matter how many blocks you inherit. |
|
Back to top |
|
babai7395 Smarty n00b
Joined: 20 Feb 2013 Posts: 2
|
Posted: Wed Feb 20, 2013 6:58 pm Post subject: |
|
|
Also tested on latest 3.1.13. Same results |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Feb 20, 2013 8:09 pm Post subject: |
|
|
Thank's for your input. I will try to fix this ASAP. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Apr 05, 2013 9:22 pm Post subject: |
|
|
This bug is now fixed in the SVN trunk.
The fix will later be included in version 3.1.14 |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|