|
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 |
gaspo Smarty n00b
Joined: 27 Apr 2010 Posts: 3
|
Posted: Tue Apr 27, 2010 7:10 am Post subject: Block function content evaluating/parsing control |
|
|
I'd like to be able to control if I get parsed content in block function and then manage it in my function, or first manage the code, and then parse the result.
In documentation you say:
Quote: | Each time the function implementation returns with $repeat being TRUE, the contents between {func}...{/func} are evaluated and the function implementation is called again with the new block contents in the parameter $content. |
So I tried to change the 4th parameter ($repeat) to false before function exits first time, but this has no affect. I still get evaluated content.
This is my function:
Code: | public function test($inParams, $inContent, &$smarty, &$repeat)
{
$repeat = false;
echo $inContent;
} |
registered as (smarty3 syntax)
Code: | $this->register->block('test', array(&$this, 'test')); |
template:
Code: |
{$foo = 'bar'}
{test}
{$foo}
{/test} |
result:
Thank you for any help |
|
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
|