|
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 |
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Aug 23, 2004 6:23 pm Post subject: modifiers are not applied to capture |
|
|
For some reason, {capture} does not apply modifiers:
Trivial example:
Code: | {capture|count_paragraphs assign=test}
Testing
{/capture}
{$test} |
Produces:
Expected:
Discussion:
This behaviour is the same for both {capture assign=foo} and {capture name=foo} with {$smarty.capture.foo} |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Aug 23, 2004 6:37 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Aug 23, 2004 6:44 pm Post subject: |
|
|
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 |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Aug 23, 2004 7:00 pm Post subject: |
|
|
Actually the only option on these two functions is to assign to a variable, there is no output otherwise. |
|
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
|