Re: [SMARTY-DEV] Compiler Code cleanup - new syntax features
| From: | Andr� Rabold | Date: | Thu, 19 Dec 2002 07:30:26 +0000 |
| Subject: | Re: [SMARTY-DEV] Compiler Code cleanup - new syntax features | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-451@lists.php.net to get a copy of this message | ||
Whoohoo!!! Thanks alot for this Monte :-D
Now I'll test the changes you made... Two things to meantion here:
> 2) objects as parameters (as discussed)
>
> won't work:
> {myfunc foo=$func->bar()}
> {$myobj->foo($blah->bar())}
I can live with that :-) But it's not really secure because you could
still do something like
{assign var="blub" value=$blah->bar()}
{$myobj->foo($blub)}
Or am I wrong?
> The syntax just wasn't put in, I wasn't sure how useful that would be.
> You can pass a constant as a parameter though. I wonder if we should
> just get rid of it and use $smarty.const._MY_CONST instead.
This sound good for me. Would be clean and understandable I think.
Thanks again,
André
"Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag
news:1040233027.11945.136.camel@lena.ispi.prv...
> I like that approach too.
>
> On Wed, 2002-12-18 at 11:34, Hans Lellelid wrote:
> > I really like the $smarty.const._MY_CONST idea. It would be consistent
> > with the fact that super-globals (like $_SERVER) are only accessible
> > through $smarty array (like $smarty.server), right? It would solve my
> > "problem" of wanting direct access also.
> >
> > Hans
> >
> > Monte Ohrt wrote:
> >
> > >The syntax just wasn't put in, I wasn't sure how useful that would be.
> > >You can pass a constant as a parameter though. I wonder if we should
> > >just get rid of it and use $smarty.const._MY_CONST instead.
> > >
> > >Monte
> > >
> > >On Wed, 2002-12-18 at 11:24, Hans Lellelid wrote:
> > >
> > >
> > >>Hi Monte,
> > >>
> > >>Sorry that I haven't been following the constants discussion closely.
> > >> What's the thinking behind not allowing direct calls to constants? --
> > >>this seems like soemthing that would be pretty useful (e.g. I often
will
> > >>set constants for things like SCRIPT_URI and SCRIPT_URL since the
> > >>$_SERVER[] var can vary depending on whether using IIS or Apache etc).
> > >>
> > >>Hans
> > >>
> > >>
> > >>
> > >>>What is NOT allowed:
> > >>>
> > >>>1) direct call to constant
> > >>>
> > >>>won't work:
> > >>>{_MY_CONST}
> > >>>
> > >>>2) objects as parameters (as discussed)
> > >>>
> > >>>won't work:
> > >>>{myfunc foo=$func->bar()}
> > >>>{$myobj->foo($blah->bar())}
> > >>>
> > >>>3) you cannot put modifiers on modifier parameters (obvious syntax
> > >>>collisions)
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
>
>