|
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 |
academo Smarty Rookie
Joined: 19 Feb 2010 Posts: 9
|
Posted: Wed Sep 29, 2010 9:44 pm Post subject: foreach continue and break? |
|
|
I did ask about this but i need to be sure about
it is any operator in foreach like continue or break?
if isn't, can be implemented by a plugun function?
Thank you very much. |
|
Back to top |
|
ZakMc Smarty Pro
Joined: 04 Oct 2004 Posts: 182
|
|
Back to top |
|
academo Smarty Rookie
Joined: 19 Feb 2010 Posts: 9
|
Posted: Thu Sep 30, 2010 9:09 pm Post subject: |
|
|
Thank you, and I'm sorry about search ;) |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Oct 01, 2010 1:52 pm Post subject: |
|
|
{break} and {continue} tags for flow control of {foreach},{section},{for} and {while} loops have been added today to the Smarty3 SVN version. |
|
Back to top |
|
academo Smarty Rookie
Joined: 19 Feb 2010 Posts: 9
|
Posted: Fri Oct 01, 2010 2:45 pm Post subject: |
|
|
Excelent!! Great improve to smarty :D |
|
Back to top |
|
ZakMc Smarty Pro
Joined: 04 Oct 2004 Posts: 182
|
Posted: Fri Oct 01, 2010 2:57 pm Post subject: |
|
|
U.Tews wrote: | {break} and {continue} tags for flow control of {foreach},{section},{for} and {while} loops have been added today to the Smarty3 SVN version. |
What changed your mind? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Oct 01, 2010 4:16 pm Post subject: |
|
|
It's a fine line. {break} and {continue} tags may lure more business logic into templates, which is not a good thing. The best route is to do the work in PHP and assign exactly what you want displayed in the template. The template then just focuses on the presentation and a simple loop. That said, use your own discretion with these tags in the template. |
|
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
|