Unfortunately it doesn't work. It works only if I have relation one to many but not when I have relation many to many.
On 1 Gru, 18:22, Jonathan Wage <[email protected]> wrote: > Maybe this? > > $this->setDefaults(array( > 'authors_list' => array(2) > )); > > > > On Tue, Dec 1, 2009 at 7:52 AM, dziobacz <[email protected]> wrote: > > But I can set default value for select list for id_book (model Books) > > or id_author (model Authors), but default value only doesn't work for > > authors_list or books_list: > > $this->setWidget('authors_list', new sfWidgetFormDoctrineChoiceMany > > (array( > > 'model' => 'Authors') > > ))); > > > $this->setDefaults(array( > > 'authors_list' => 2 > > )); > > > On 1 Gru, 11:35, Thomas Rabaix <[email protected]> wrote: > > > When you work with a sfMODELform then the defaults are not used. If > > > you want to set default value in this case, just set the value to the > > > related object > > > > $u = new User; > > > $u->my_default_value = 'asds'; > > > > $f = new sfUserForm($u) > > > > On Tue, Dec 1, 2009 at 10:28 AM, dziobacz <[email protected]> > > wrote: > > > > I couldn't set default value for sfWidgetFormDoctrineChoiceMany in > > > > relation many to many (not one to many), I asked here and nobody know > > > > so I created ticket here:http://trac.symfony-project.org/ticket/7712 > > > > Why my ticket is invalid ? > > > > > -- > > > > > 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]<symfony-users%[email protected]> > > . > > > > For more options, visit this group athttp:// > > groups.google.com/group/symfony-users?hl=en. > > > > -- > > > Thomas Rabaixhttp://rabaix.net > > > -- > > > 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]<symfony-users%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en. > > -- > Jonathan H. Wage (+1 415 992 5468) > Open Source Software Developer & Evangelist > sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org > > You should follow me on Twitter:http://www.twitter.com/jwage > > You can contact Jonathan about Doctrine, Symfony and Open-Source or for > training, consulting, application development, or business related questions > at [email protected] -- 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.
