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

From: Date: Fri, 28 Feb 2003 16:47:51 +0000
Subject: Re: [SMARTY-DEV] $smarty.const.CONSTANT
References: 1 2 3 4  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-870@lists.php.net to get a copy of this message
Oh, and backticks are only supported within quotes at the moment. I don't know if it should go beyond that. They are only used to separate a variable from surrounding text, not to extraplate how a variable is interpreted by Smarty. Monte On Fri, 2003-02-28 at 10:35, André Rabold wrote: > Cool, thanks! > > I haven't it tested yet but I just want to ask some questions. Is / will the > following syntax be supported? > > {$foo.bar[0].foobar[index]} <-- backticks if not used within > a quoted > string > {$foo.bar[0].foobar[index]} <-- foobar[index] indexed > $bar[0], the result > indexes $foo > {blah blub="$foo.$bar[0].foobar[index]"} <-- the > same as the line above > but as quoted string > {blah blub="$foo.$bar[0].foobar[index]``"} <-- > cascaded backticks > > If it's not supported (I think so), should it be supported? I don't really > know :-/ > > André > > > > "Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag > news:1046445020.7653.4.camel@lena.ispi.prv... > > 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> > > -- Monte Ohrt <monte@ispi.net>

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