You could of course implement this similar to Propel, by having a base
class that's extended with an empty class that you can replace with your
own.
>
> You can't override it partially.
>
> Imagine that you have
>
> class myJavascript extends sfJavascript
> {
> public static function link_to_remote()
> {
> //do things
> }
> }
>
> Ho do you change all calls to sfJavascript::link_to_remote() by calls
> to myJavascript::link_to_remote() without changing the template code ?
>
> That's why a variable containing an instance of the helper object is
> more extensible.
>
> François
>
> 2008/7/3 Andreas Hucks <[EMAIL PROTECTED]>:
>>
>> Why not static methods?
>>
>> sfJavascript::link_to_remote()
>>
>> Supports autoloading, namespaces, is clean and readable, is OOP.
>>
>> Cheers,
>> Andreas
>>
>>
>> Bernhard Schussek schrieb:
>>> I don't like the $h idea. It's complicated to understand for new
>>> developers, the extra squared brackets and quotes add unnecessary
>>> complexity and are prone to errors and last but not least, the array
>>> syntax is totally misused.
>>>
>>> IMO we should opt for the most simple, but most obvious solution: By
>>> simply defining the objects in the template.
>>>
>>> <?php $Url = new sfUrlHelper ?>
>>>
>>> <html code...>
>>>
>>> <?php echo $Url->link_to(....) ?>
>>>
>>> This way it's very easy to grasp what's going on, without adding
>>> unnecessary extra magic.
>>>
>>>
>>> Bernhard
>>>
>>>
>>> On Wed, Jul 2, 2008 at 9:41 PM, Tristan Rivoallan
>>> <[EMAIL PROTECTED]> wrote:
>>>> On Wed, Jul 2, 2008 at 8:03 PM, Marijn Huizendveld
>>>> <[EMAIL PROTECTED]> wrote:
>>>>
>>>>> I can see some advantages besides the namespacing. Let's just say
>>>>> that all the helpers inherit their functionality from the library.
>>>>> Becase of the oop nature those helper functions are easily
>>>>> overwritten without _losing_ the original functionality. E.g.
>>>> indeed. i said i liked the "$h" idea because it was not too cumbersome
>>>> to use. (even if it's a bit more complicated than the actual helpers).
>>>>
>>>> ++
>>>> tristan
>>>>
>>>> --
>>>> Tristan Rivoallan
>>>> http://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
-~----------~----~----~----~------~----~------~--~---