0

Zend\Form\View\Helper\FormSelect を使用していますが、select 要素で選択した値を設定する方法が見つかりませんでした。

$countryList = array_merge (array('empty_option' => 'Please choose...'),     
$this->common()->getCountryList() );
$country->setValueOptions($countryList);
$country->setValue(array('AT' => 'AUSTRIA'));
echo $this->formSelect($country);
4

1 に答える 1

1
$country->setValue('AT');
As above, you can use setValue() for making 'AT' as selected.
于 2013-06-22T04:07:31.680 に答える