Re: [SMARTY-DEV] $smarty.const.CONSTANT
| From: | messju mohr | Date: | Fri, 28 Feb 2003 12:29:15 +0000 |
| Subject: | Re: [SMARTY-DEV] $smarty.const.CONSTANT | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-866@lists.php.net to get a copy of this message | ||
On Fri, Feb 28, 2003 at 12:59:08PM +0100, Nichlas Löfdahl wrote:
> Greets!
>
> It's seems like the latest CVS-version of Smarty messes upp the {$smarty.const.CONSTANT}
> syntax. It gets compiled to:
>
> <?php echo (defined("CONSTANT") ? "CONSTANT" : null); ?>
>
> Those "" around the constant seem omnious :)
indeed. the first pair of " is correct (defined() takes the constant's
name, not the constants value). the second pair is wrong.
a quick fix would be:
diff -r1.183 Smarty_Compiler.class.php
1752c1752
< $compiled_ref = "(defined($_val) ? $_val : null)";
---
> $compiled_ref = "(defined($_val) ? constant($_val) :
> null)";
maybe Monte has a better one.
> /Nichlas
have fun
messju