Hi,

+1 converting helpers to classes. I often stumble on the problem not  
to be able to overwrite special helpers.

I do not like this approach:

 >> "$h['helpername']->feature()"

You will have offset problems in this case and could not catch  
problems during retrieving the according helper classes very easily.



Like Fabien, i would do it this way:
 >> <?php $url = $helper->get('url') ?>

or better $sf_helper->get('url')

So you see on the first view that $sf_helper is another magic class  
for the templates due to the "sf_" prefix.


 >> To elaborate further...
 >> $url = $helper->get('url');
 >> I am really opposed to this syntax given that it does not allow for
 >> code hinting in most IDE's. To me that is a big hit for the  
framework...

Just add this line in your code
$url = $helper->get('url');
/[EMAIL PROTECTED] $url sfUrlHelper*/

and your code completion should work again (it does in Zend Studio).



- Frank


Am 05.07.2008 um 13:43 schrieb Andreas Gehrke:

>
> I dont believe the following is explicit:
>
> $url = sfHelper:get('url');
> $url->link_to('@blah');
>
> What is $url? Ahh, its an object. Which method does it have? This is
> not clear for a designer.
>
> About extending and overriding helpers: What does most helpers do?
> They print HTML. How would you extend this behavior? Call the old
> helper and do a series of preg_replace() calls or just append some
> more HTML? I dont see why you need OOP inheritance and polymorphism
> for this. Just create a need helper and tell you designer to use this,
> or as another mentioned: do a search-and-replace in your existing
> templates to call the need helper.
>
> /Andreas Gehrke
>
> On Jul 4, 10:20 am, "Tristan Rivoallan" <[EMAIL PROTECTED]>
> wrote:
>> On Fri, Jul 4, 2008 at 10:00 AM, Andreas Gehrke <[EMAIL PROTECTED]>  
>> wrote:
>>
>>> I agree. Templates is for designers and helpers should be easy to  
>>> use
>>> and very explicit. Designers don't know OOP and shouldn't be forced
>>> understand it.
>>
>>> Please keep the existing explicit syntax. It works great :-)
>>
>>> Btw, the above discussion clearly bear the mark of being between
>>> developers. Shouldn't this decision at least be discussed with the
>>> designers whom actually are going to use the functionality?
>>
>> you are right : it must remain explicit and clear for designers.
>> but developers being able to override default helpers is also a good
>> thing for designers, as developers could provide better tools to  
>> them.
>>
>> i don't think that anyone needs to understand oop to write
>> $url->link_to(); or $form->checkbox_tag(); ? Actually, it makes more
>> sense + wouldn't designers be happy to get syntax hints +
>> documentation as they code ?
>>
>> ++
>> tristan
>> ++
>> tristan
>>
>> --
>> Tristan Rivoallanhttp://www.clever-age.com
>> Clever Age - conseil en architecture technique
>> GSM: +33 6 219 219 33 Tél: +33 1 53 34 66 10
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to