i want to display combo box using symfony. In the CountryForm.php i have created widget as :
开发者_开发技巧$this->setWidgets(array('country' => new sfWidgetFormChoice(array('choices' => array()))));
for this validator as:
$this->setValidators(array('country' => new sfValidatorChoice(array('choices' => array(array_keys($countries))))));
I am getting error as 'Invalid' for this combobox. Any idea's on this? Thanks in advance ..
array_keys
returns an array. Try:
$this->setValidators(array(
'country' => new sfValidatorChoice(array(
'choices' => array_keys($countries)
))
));
精彩评论