繁体   English   中英

如何在zend framework2中使用表单选择元素的选择选项?

[英]how to use selected option of form select element in zend framework2?

我正在使用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);
$country->setValue('AT');
As above, you can use setValue() for making 'AT' as selected.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM