0

我正在使用 Zend\Form\View\Helper\FormSelect 并且我没有找到在选择元素中设置选定值的方法。

$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 回答