Re: object support
| From: | Andr� Rabold | Date: | Fri, 10 Jan 2003 09:50:31 +0000 |
| Subject: | Re: object support | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-508@lists.php.net to get a copy of this message | ||
Why not adding a configuration flag to Smarty to enable/disable object
support. The way you do it now (if I uncomment the object functionality in
CVS) works great. Even if you stop supporting objects officially, it would
be easy to enable it if I want it. Now I always have to uncomment it :-/
Thanks,
André
"Monte Ohrt" <monte@ispi.net> schrieb im Newsbeitrag
news:1041979890.30944.46.camel@lena.ispi.prv...
> I haven't heard much feedback on the object support. I'm leaning toward
> not supporting any new syntax for it. A new syntax only complicates the
> engine IMHO, and warrants further complications later. If you want
> objects, you'll have to use a custom function (which may get included
> with the distribution.)
>
> so object access could look something like this (no decisions made yet):
>
> {object name="foo" method="bar"}
>
> If you want to use an object's output as a variable, you'd have to
> assign it first:
>
> {object name="foo" method="bar" assign="output"}
> {myfunc arg1=$output}
>
> parameters to objects will have to be handled somehow, maybe just
> arbitrarily... name, method, and assign are reserved, all else treated
> as parameters?
>
> {object name="foo" method="bar" p1="foobar1"
> p2="foobar2" ...}
>
>
>
> The alternative is to support object syntax:
>
> {$obj->meth($p1,$p2,"p3")}
>
>
> This can get pretty messy, especially if you want support for things
> like objects as parameters to objects, PHP functions as parameters,
> objects within objects, etc. I think I'd rather leave this out and only
> support a limited access method via a custom function (or limited to
> your own concoction of custom functions or pre/post filters.)
>
> Monte
>