 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
clone46 Smarty Rookie
Joined: 13 Jan 2006 Posts: 13
|
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: 7038 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: 13
|
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
|