Re: embedded variable handling

From: Date: Wed, 19 Feb 2003 15:54:34 +0000
Subject: Re: embedded variable handling
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-739@lists.php.net to get a copy of this message
I vote for the way PHP does it. String --> what will be imbedded "blah $foo blah" --> $foo "blah $foo[0] blah" --> $foo[0] "blah $foo[0][1] blah" --> $foo[0] (like PHP) or $foo[0][1] (to be discussed) "blah $foo.bar blah" --> only $foo (not .bar) Perhaps Smarty shoud begin supporting real concatenating of strings and variables so these problems will be solved for all time. André "Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag news:1045668761.28261.31.camel@lena.ispi.prv... > We need to make an important decision here. > > Example of problem: > > {include file="$page.tpl"} > > Should the embedded variable be seen as $page or $page.tpl ? We are > having problems where people expect that the ".tpl" is not seen as part > of the variable. > > Smarty used to only allow $foo imbedded variable syntax, until we had a > request that $foo[0] should work too, so full syntax support was > enabled. So you can do something like this: > > "texttext $foo.bar[0][3].blah[index] texttext" > > Now, do we restrict embedded variable syntax to only $foo, or do we > support $foo[0][bar] but not $foo.bar, or just leave things as is and > support full variables? > > Monte > > > -- > Monte Ohrt <monte@ispi.net> >

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