defaults value must be passed when the form is instanciate. so don't do any think at the view layer...
$default = $this->getUser()->getAttribute('values'); $form = new myForm($default); if you work with a doctrine form $default = $this->getUser()->getAttribute('values'); $object = new Object; $object->fromArray($default); $form = new myObjectForm($object) On Wed, Apr 28, 2010 at 8:39 AM, Parijat Kalia <kaliapari...@gmail.com>wrote: > Sorry, haven't yet used the form widget framework..still stuck on good old > strategies! > > On Tue, Apr 27, 2010 at 8:39 PM, fRAnKEnSTEin <shirkav...@gmail.com>wrote: > >> hi, >> >> The problem is that i am using a form, so instead of cretaing a >> "select_tag" in the template, i use for example something like this in >> my form class: >> >> ... >> new sfWidgetFormSelect(array( 'choices' => $this->getGroupChoices() )) >> ... >> in the form class a tryed to retrieve my session variables using >> symfony session object like: >> >> $a = $this->getUser()->getAttribute('nickname'); >> >> but this send an error telling me that the $this->getUser() does not >> exists. >> >> So, how can set the value of a combo based con a session variable, >> when this combo is created inside a form class using forms widgets? >> >> what i lik to do is something like <?php echo $form('combo')- >> >render(array(...), "selected" => "3") //so the number 3 is stored in >> the session variable, and here tels de helper to marck as selectes >> the index 3 of the combo >> >> ideas? >> >> Cheers >> >> -- >> If you want to report a vulnerability issue on symfony, please send it to >> security at symfony-project.com >> >> 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<symfony-users%2bunsubscr...@googlegroups.com> >> For more options, visit this group at >> http://groups.google.com/group/symfony-users?hl=en >> > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > 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<symfony-users%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Thomas Rabaix http://rabaix.net -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com 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