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

modifiers are not applied to capture

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Aug 23, 2004 6:23 pm    Post subject: modifiers are not applied to capture Reply with quote

For some reason, {capture} does not apply modifiers:

Trivial example:
Code:
{capture|count_paragraphs assign=test}
Testing
{/capture}
{$test}

Produces:
Quote:
Testing

Expected:
Quote:
1

Discussion:
This behaviour is the same for both {capture assign=foo} and {capture name=foo} with {$smarty.capture.foo}
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Aug 23, 2004 6:37 pm    Post subject: Reply with quote

Capture does not produce output, so applying a modifier does not make sense. In the same sense, you cannot apply a modifier to the {include} function.
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Mon Aug 23, 2004 6:44 pm    Post subject: Reply with quote

mohrt wrote:
Capture does not produce output, so applying a modifier does not make sense. In the same sense, you cannot apply a modifier to the {include} function.


The same appears to also be the case with assign. I'm not sure I follow the reasoning, though: for both capture and assign, the output is indeed evaluated and placed into the contents of a variable.

Never-the-less, if that is the expected behaviour, I can accept that Smile
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Mon Aug 23, 2004 7:00 pm    Post subject: Reply with quote

Actually the only option on these two functions is to assign to a variable, there is no output otherwise.
Back to top
View user's profile Send private message Visit poster's website
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 -> Bugs 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