You are here: Re: [SMARTY] Calling object methods « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] Calling object methods

Posted by boots on 06/18/05 01:59

You are correct in pretty much every statement. Yes: it would break
template compatibility -- but that's what people tend to care about; a
new 3.x version written in PHP5 is the current plan that I am aware of
while the 2.x series would continue to be maintained for PHP4 users
(which also suggests that putting PHP5 only features in the 2.x series
is not of the highest benefit).

Never-the-less, I take exception to one statement: Smarty is not broken
for PHP5. It simply doesn't support everything that PHP5 can do which
is very different than being broken.

Best,
xo boots

--- Joe Stump <joe@joestump.net> wrote:
> 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация