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
Post a Comment