2010-07-28 5 views
1

심포니를 사용하여 콤보 상자를 표시하고 싶습니다. CountryForm.php에서 위젯을 다음과 같이 작성했습니다.양식 제출시 sfWidgetFormChoice에 '올바르지 않습니다'오류가 발생했습니다.

$ this-> setWidgets ('country'=> new sfWidgetFormChoice (array ('choices'=>))))))))); 등이 검증에 대한

:

$ this-> setValidators (배열 ('국가'=> 새로운 sfValidatorChoice (배열 ('선택'=> 배열 (array_keys ($ 개국))))));

이 콤보 박스에서 '잘못되었습니다'오류가 발생합니다. 어떤 생각이야? 미리 감사드립니다.

답변

2

array_keys은 배열을 반환합니다. 시도 :

$this->setValidators(array(
    'country' => new sfValidatorChoice(array(
     'choices' => array_keys($countries) 
)) 
)); 
관련 문제