But that doesn't work in a form - why ? : $firm = $this->getOption("firm"); $this->setDefault('contact', $firm['Translation']['pl'] ['description']);
On 9 Lis, 00:10, "rooster (Russ)" <russmon...@gmail.com> wrote: > Options are passed as an array to the second argument. > > $this->form = new ContactForm(array(), array("firm" => $firm)); > > Then in your form class: > > $this->getOption("firm"); > > Although in your case - if you are just trying to set defaults you can > use the first array for that. > > On Nov 8, 10:10 pm, dziobacz <aaabbbcccda...@gmail.com> wrote: > > > I have array: > > $firm['Translation']['pl']['address'] = "aaaa"; > > $firm['Translation']['pl']['description'] = "bbbbb"; > > $firm['Translation']['en']['address'] = "ccccc"; > > $firm['Translation']['en']['description'] = "ddddd"; > > > In action I am trying to pass this array to the form: > > $this->form = new ContactForm($firm); > > > In form I want to get value from table and pass it to the default > > value to input: > > $this->setDefault('contact', $firm['Translation']['pl']['address']); > > > But it makes error: > > Undefined variable: firm > > > So what is going on ? > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---