|
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 |
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Thu Dec 01, 2011 7:15 pm Post subject: Not matching {capture} open/close |
|
|
index.html: Code: | {include 'aaa.html' x=1} |
aaa.html: Code: | {if $x lt 5}
{$x}
{capture name='aaa'}{include 'aaa.html' x=$x+1}{/capture}
{/if} |
Output: Code: | 1 2
Exception "Not matching {capture} open/close in "aaa.html"" |
|
|
Back to top |
|
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Thu Dec 08, 2011 6:42 pm Post subject: |
|
|
Any ideas? Do you confirm this bug? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Dec 08, 2011 7:33 pm Post subject: |
|
|
I can see why this error message is throw.
But what sense it does make either to open in a recurive {include} recursive {capture} stack.
What do you wnat to achive? |
|
Back to top |
|
douglassdavis Smarty Junkie
Joined: 21 Jan 2008 Posts: 541
|
Posted: Thu Dec 08, 2011 7:37 pm Post subject: Re: Not matching {capture} open/close |
|
|
Out of curiosity... Does this work?
Code: | {if $x lt 5}
{$x}
{capture name="aaa$x"}{include 'aaa.html' x=$x+1}{/capture}
{/if} |
|
|
Back to top |
|
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Fri Dec 09, 2011 3:47 pm Post subject: |
|
|
U.Tews wrote: | But what sense it does make either to open in a recurive {include} recursive {capture} stack. |
Recursion is common programming technique. Capture may be used for various reasons, for example - to check that captured data is not empty.
In any case:
1. the error message "Not matching {capture} open/close" is incorrect. The capture tag is properly closed.
2. this code used to work in Smarty 3.1.4.
douglassdavis wrote: | Out of curiosity... Does this work? |
No, it does not. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Dec 09, 2011 10:07 pm Post subject: |
|
|
The bugfix is now in the SVN trunk version and will later be included in 3.1.7 |
|
Back to top |
|
ilyalyu Smarty Regular
Joined: 03 Nov 2009 Posts: 72
|
Posted: Sat Dec 10, 2011 6:43 am Post subject: |
|
|
Thx. Now it works |
|
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
|