2

我有一个带有下拉列表的表单,其中包含这样设置的状态列表。

$this->addfield('State','state')->setValueList(array('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming')); 

我希望下拉菜单默认为纽约。如何在敏捷工具包中做到这一点?

4

1 回答 1

1

你试过链接吗

->defaultValue('New York')

?

http://agiletoolkit.org/doc/modeltable/fields

于 2012-12-31T02:47:21.790 回答