Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Block function content evaluating/parsing control

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
gaspo
Smarty n00b


Joined: 27 Apr 2010
Posts: 3

PostPosted: Tue Apr 27, 2010 7:10 am    Post subject: Block function content evaluating/parsing control Reply with quote

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:

Code:
bar


Thank you for any help
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Feature Requests All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP