Thanks for confirming, that's what I thought as well. On Wed, Nov 12, 2008 at 12:09 PM, Thomas Dedericks < [EMAIL PROTECTED]> wrote:
> > Hi, > > If you're adding widgets to a generated or previously defined form, you > should use > > $this->widgetSchema['my_new_widget'] = new sfWidget... > > and > > $this->validatorSchema['my_new_widget'] = new sfValidator... > > setWidgets() should only be used if you're building the form from > scratch, imho. > > > Le mercredi 12 novembre 2008 à 12:01 +0200, Rytis Daugirdas a écrit : > > Hello, > > > > What is the preferred way to add a new widget and its validator(s) to > > a form that already has some widgets configured? The documentation > > only indicates setWidgets() method, there's no setWidget() or > > addWidget() method. From what I see, I can probably use setWidgets() > > for that: > > > > $widgets = $this->widgetSchema->getFields(); > > $widgets['my_new_field'] = new sfWidgetFormInput(); > > $this->setWidgets($widgets); > > > > But this looks odd. What about this? > > > > $this->widgetSchema['my_new_field'] = new sfWidgetFormInput(); > > > > But I'm not sure if that would work correctly since setWidgets() does > > more than only assigning the widgets to the schema. > > > > What's the "right" way? > > > > -- > > Regards, > > Rytis > > > > > > -- > > Thomas Dedericks > > [EMAIL PROTECTED] > GSM: +32 (0) 499 23 60 22 > http://tequila-studio.com > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
