【发布时间】:2013-04-15 18:31:34
【问题描述】:
我有一些属性的表单:
class ToraForm extends Form
{
public function __construct($name = null)
{
parent::__construct('tora');
$this->setAttribute('method', 'post');
$this->add(array(
'name' => 'id',
'attributes' => array(
'type' => 'hidden',
),
));
$this->add(array(
'name' => 'name',
'attributes' => array(
'type' => 'text',
'required' => true,
),
'options' => array(
'label' => 'name',
),
));
}
但我想添加下拉列表,其中包含取自另一个模型的数据。怎么办?
【问题讨论】:
标签: zend-framework2 zend-form2