1
投稿フォームのフォーム選択ウィジェットからどのように価値を得ることができますか?フォームの選択から価値を得るSymfony 1.4
これで、選択したオプションの整数インデックスのみが返されますが、値が必要です。以下は
は私のコードです:
$this->setWidget('emails',new sfWidgetFormChoice([
'label' => __('Emails'),
'expanded' => true,
'multiple' => true,
'choices' => ['[email protected]', '[email protected]'],
]));
$this->setValidators([
'emails' => new sfValidatorChoice(
['choices' => array_keys($this->getDefault('emails')), 'multiple' => true],
['required' => __('Required')]),