【问题标题】:How can I initialize Zend_Form_Element_Select with a config array?如何使用配置数组初始化 Zend_Form_Element_Select?
【发布时间】:2010-09-10 17:39:46
【问题描述】:

我试过了:

$form->addElement(
    'select',
    'salutation',
    array(
        'required' => true,
        'options' => array(
            'Mr.' => 'Mr.',
            'Mrs.' => 'Mrs.',
            'Ms.' => 'Ms.',
        ), 
    )
);

然后我print_r()ed 表格,称呼的选项为空。有人知道正确的拼写吗?据我所知,没有关于 Zend 元素配置格式的文档。

【问题讨论】:

    标签: php html zend-framework


    【解决方案1】:

    您应该使用“multiOptions”而不是“options”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多