LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Dave Mittner Date: Thu Jan 3 11:11:04 2008 Subject: RE: [SMARTY-DEV] Chained method calls
I'm +1 for it, as well. I've tended to walk the line between what others
perceive as acceptable template usage and I've passed quite a few objects
into templates to be accessible should the template need the data there-in.
A good example is a user object. But what if the user object has a company
object? $user->getCompany()->getCompanyName(). I don't think that'd be
breaking too many accepted conventions. And to compare to other templating
engines, I believe Velocity supports such syntax.
I personally see this opening more doors than it would cause problems,
myself. It's adding optional support that, in its absence, might require
people to assign temporary Smarty variables- an ugly process in and of
itself.
Rikaelus
-----Original Message-----
From: messju mohr [mailto:messju@lammfellpuschen.de]
Sent: Thursday, January 03, 2008 3:40 AM
To: smarty-dev@lists.php.net
Subject: Re: [SMARTY-DEV] Chained method calls
I'm +1 for adding this, too. I know the reason this was not added to
Smarty is, that this does not work under php4. Smarty would generate
broken php code under php4 when doing {$foo->bar()->baz()}.
I don't think that the possible impact on php4 is such a big
deal. Some template code that did not compile before (Smarty syntax
error) does now throw a php syntax error. But the benefits for php5
are there - and counting the number of requests for this feature the
demand seems high.
greetings
messju
On Sun, Dec 09, 2007 at 01:27:50PM -0200, Diego Feitosa wrote:
> Hi all,
>
> Today, working with Smarty, I realized that a simple feature (chained
> method calls) was not present... Hopefully, after 2 minutes searching at
> google, I found this patch:
> http://codepoets.co.uk/smarty_chained_function_calls
>
> Is there any possibility to include this patch into the engine??
> I think this will be very usefull :)
>
> I don't know how much impact this can bring to the entire distribution,
> but at least here, there's no negative impact.
>
> Thanks!!
> --
> Diego Feitosa
> www.dnfeitosa.com <http://www.dnfeitosa.com>
--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
| Navigate in group php.smarty.dev at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |