Re: [SMARTY-DEV] $smarty.const.CONSTANT

From: Date: Fri, 28 Feb 2003 15:10:21 +0000
Subject: Re: [SMARTY-DEV] $smarty.const.CONSTANT
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-867@lists.php.net to get a copy of this message
This is fixed. Also, full dollar var syntax is allowed in quotes since they can be escaped. example: {include file="$foo.bar[0].foobar[index].tpl"} Monte On Fri, 2003-02-28 at 06:29, messju mohr wrote: > 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 -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.dev (#867) next »