How to set selected values using sfWidgetFormSelectMany in Symfony1? -


i want use sfwidgetformselectmany inside sfform. have no problems setting choices select, how set selected values when loading form?

this code sfwidgetformselectmany far:

$choices = $this->getscopes();  $this->widgetschema['application_scopes'] = new sfwidgetformselectmany(array(   'choices' => $choices )); $this->validatorschema['application_scopes'] = new sfvalidatorchoicemany(array(   'choices' => array_keys($choices) )); 

so, have answer question myself. best way ask question find answer ;-)

as inside form class, can set values this:

$this->setdefault('application_scopes', array('this','that')); 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -