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

Posted by Jochem Maas on 06/17/05 13:43

boots wrote:
> To be fair, it was never claimed that Smarty WAS PHP. The fact that
> something is possible in PHP is no gaurantee that it will be possible
> in Smarty; however, the fact that something ISN'T possible in PHP is
> often indicative that it won't be doable in Smarty. Ergo the PHP4
> argument. The PHP5 sarcasm is rather unfair.

yes but the fact that hardly anyone of the 'big' open php projects
show any/much interest in going php5 is not exactly a come-on for the
general public is it?

IMHO php5 is really so much of an improvement and it deserves more support
- so that feetdragging ISPs start to actually offer it!!!

>
> Its not that the idea is bad (or hasn't already been considered) its
> just that it is completely non-BC. I would think it would make a good

in what way does being able to write {$foo->bar()->bar()} break BC?
maybe it's obvious but I don't see it. maybe its an implementation problem,
(I have hacked Smarty for this very issue so I understand that this is
not a simple issue per se!)

> candidate for a future version but at the same time, I think it will
> promote several questionable practices for template usage (such as
> deeply nested hierarchies).

I don't understand what you mean by 'deeply nested hierarchies' in this
context - could you explain please?

regardless, Smarty is a nice tool. thanks for all the work you (et al)
have put into it!

rgds,
Jochem

>
> Best Regards.
>
> --- Joe Stump <joe@joestump.net> wrote:
>
>
>>You're right, we should ignore PHP5. Sarcasm aside, I would assume
>>the Smarty developers would like Smarty to be PHP5 friendly and
>>support as much PHP5 stuff as possible. I don't see this as a
>>"feature", but simply the fact that Smarty isn't fully PHP5
>>compatible.
>>
>>So, I guess, it's not a bug since Smarty doesn't tout itself to be
>>PHP5 compatible. When it *does* tout itself as PHP5 compatible and
>>this problem isn't fixed *then* it would be a bug.
>>
>>Either way this should be filed as a "bug report" - whether it's
>>filed as a "feature" or a "bug" is up to whoever submits it I
>>suppose. Like I said, this problem breaks what I perceive to be
>>expected behavior only because ($foo->bar()} already works in Smarty.
>>
>>--Joe
>>
>>On Jun 16, 2005, at 9:35 AM, boots wrote:
>>
>>
>>>--- Joe Stump <joe@joestump.net> wrote:
>>>
>>>
>>>>If that's the case I'd file a bug report. If you're running Smarty
>>>>under PHP5 this should work fine I would think - at least I'd
>>
>>expect
>>
>>>>it to.
>>>>
>>>
>>>Why? Nowhere in the Smarty docs is it suggested that this is
>>
>>possible.
>>
>>>Smarty is PHP4 library and it inherits PHP4's biases.
>>>
>>>xo boots
>>>
>>>
>>>
>>>>--Joe
>>>>
>>>>On Jun 16, 2005, at 9:19 AM, messju mohr wrote:
>>>>
>>>>
>>>>
>>>>>On Thu, Jun 16, 2005 at 09:15:39AM -0700, Joe Stump wrote:
>>>>>
>>>>>
>>>>>
>>>>>>What you're doing only works under PHP5. You can't do
>>
>>$foo->bar()-
>>
>>>>>>
>>>>>>>display() in PHP4. That being said, if you ARE running PHP5
>>
>>this
>>
>>>>>>>
>>>>>>should work just fine and, if it's not, then you've most likely
>>>>>>
>>>>
>>>>found
>>>>
>>>>
>>>>>>a bug.
>>>>>>
>>>>>>
>>>>>
>>>>>yes, this works in php5, but not in a smarty template.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>--Joe
>>>>>>
>>>>>>On Jun 15, 2005, at 6:28 PM, Garret Heaton wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Is there a way to call a method on an object returned from
>>>>>>>
>>>>
>>>>another
>>>>
>>>>
>>>>>>>method in Smarty?
>>>>>>>
>>>>>>>I'm trying to do: {$obj->getSomeObject()->getSomeString()} but
>>
>>it
>>
>>>>>>>can't understand it. Is there any way to get around this. I
>>
>>want
>>
>>>>to
>>>>
>>>>
>>>>>>>avoid calling getSomeObject() before loading the template so
>>
>>that
>>
>>>>>>>things are cleaner.
>>>>>>>
>>>>>>>Thanks,
>>>>>>>Garret
>>>>>>>
>>>
>>>
>>
>

 

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

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