Re: Incompatibility to older versions again
| From: | Rainer Collet | Date: | Tue, 18 Feb 2003 18:26:43 +0000 |
| Subject: | Re: Incompatibility to older versions again | ||
| References: | 1 | Groups: | php.smarty.dev php.smarty.general |
| Request: | Send a blank email to php-smarty-dev+get-720@lists.php.net to get a copy of this message | ||
> On an afterthought, I'm wondering if we should enforce good
> habits with OO programming. One issue is direct access to
> properties... in reality you shouldn't access an object
> property directly, but through a method instead.
Yes of course you are right. But I designed these object (with arrays of
data as properties) as smarty had no syntax for accessing method.
After your last CVS-Commit now it works, thanks, but I have another one
:-((
{$obj->obj_array[index]->prop} (in sections)
Still does not work.
> We could just allow access to methods only, enforcing good OO
> practice and simplifying Smarty. I suppose that could cause
> an uproar though from already established OO property access.
> Besides, Smarty doesn't abide by these rules itself. Example,
> we set the template_dir directly instead of using something
> like set_template_dir().
>
> Did I open a can of worms? ;-)
I think it it a good idea only allowing access to methods, but smarty
should still have a compatibility-mode.
Smarty is a gread engine and I think it already widly used. It is not
very fair to exclude a group of user from upgrades ;-)
Thanks,
Rainer