Smarty gotcha
| From: | Travis Low | Date: | Sun, 21 Sep 2003 02:45:24 +0000 |
| Subject: | Smarty gotcha | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10252@lists.php.net to get a copy of this message | ||
Just found a gotcha...
If you use "!" (boolean NOT) in a Smarty if statement, there must be a space between the "!" and the following "$", or the expression will always be true. In my specific case, the code is:
{{if ! $p.link}}
stuff
{{else}}
other stuff
{{/if}}
I didn't see the "other stuff" until I changed:
{{if !$p.link}}
to
{{if ! $p.link}}
cheers,
Travis
--
Travis Low
<mailto:travis@dawnstar.com>
<http://www.dawnstar.com>