Re: [SMARTY-DEV] $smarty.const.CONSTANT
| From: | Andr� Rabold | Date: | Fri, 28 Feb 2003 16:35:35 +0000 |
| Subject: | Re: [SMARTY-DEV] $smarty.const.CONSTANT | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-868@lists.php.net to get a copy of this message | ||
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>
>