Re: [SMARTY] Calling object methods

Joe Stump <[email protected]>
Newsgroups gmane.comp.php.smarty.general
Message-ID <[email protected]>
Wait. I'm confused. {$foo->bar()->display()} would break backwards  
compatibility, but rewriting Smarty for PHP5 wouldn't?  Plus, how  
would allowing for {$foo->bar()->display()} break Smarty's ability to  
run on PHP4? It would only break that template's ability to run on PHP4.

I see a few solutions here:

1.) Just make it so Smarty can handle PHP5 dereferencing. This would,  
of course, break the templates (again, not Smarty itself), if they  
were ran under PHP4.

2.) Have two versions of Smarty (2.x is PHP4, 3.x is PHP5). I'm sure  
this is probably already in progress to some degree (PHPUnit and  
phpDocumentor both have dual versions out right now).

The fact still remains - Smarty is broken under certain circumstances  
for PHP5. To get around this problem you will have to do the following:

{assign var="bar" value=$foo->getClass()}
{$bar->display()}

--Joe

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.