|
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 |
clone46 Smarty Rookie
Joined: 13 Jan 2006 Posts: 15
|
Posted: Thu Dec 02, 2010 5:46 pm Post subject: 'unless' statement, like Perl's |
|
|
Hello!
I would love to see the addition of the 'unless' statement. It's basically the same as "if not". It would work something like this:
{unless $foo == 6}
do something
{/unless}
It's most convenient in situations like this:
{unless $foo == 6 && $bar == 4}
do something
{/unless}
Thanks,
- Bret |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Dec 02, 2010 5:59 pm Post subject: |
|
|
It's just syntax fodder
Code: | {if !( $foo == 6 && $bar == 4 )}
do something
{/if} |
FYI Smarty 3 you are free to make your own compiler funcs. |
|
Back to top |
|
clone46 Smarty Rookie
Joined: 13 Jan 2006 Posts: 15
|
Posted: Thu Dec 02, 2010 7:52 pm Post subject: |
|
|
Yup, it's just "syntactic sugar". mmmm... candy. |
|
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
|