naholyr wrote: > I'm currently looking for a clean way to add methods to sfForm, and I > see no other way than writing directly in the sfForm.class.php file : > ( (for information, I was trying to implement what's described in this > article : http://webmozarts.com/2009/04/12/improving-the-forms ) > > If there is another way, I would pleased to know it (but it would then > take better place in users ML), but it reminds me each time how > extending core classes is a real pain when it's not made this way. > > Would it be such an overhead to use sfMixer on all the core classes ? > At lease the main ones that cannot be put in factories.yml like > sfForm, sfActions, etc... > > If sfForm had a few sfMixer::callMixins() in its methods and the __call > () magic, I could add my "addField()" method in a plugin, the clean > way. Instead of this I have two choices : > - Patch sfForm.class.php : beuark ! > - Make a "myForm" class which extends sfForm (good) but patch all > classes extending sfForm to make them extend myForm instead : > beeeeeuuuuark !
If you use Propel, you can edit BaseFormPropel.class.php which is placed in the project (and all auto-generated Propel forms extend it). I don't know why Doctrine doesn't have something like this, I've really learned to love it for extending my forms. David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to symfony-devs@googlegroups.com To unsubscribe from this group, send email to symfony-devs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---