开发者

zend framework - Remove optgroup from select box

In zend framework, how do you guys remove the optgroup from a select element?

Zend puts th开发者_开发知识库em by default but I don't want it.

I would think there would be an option like

array( 'optgroup' => false )


Dont't use the optgroup feature, see the 2 examples:

$form = new Zend_Form();
$form->addElement('select', 'city', array(
    'label' => 'Nested City List',
    'multiOptions' => array(
        'Jordan' => array(
            'ptr' => 'Petra',
            'amm' => 'Amman',
        ),
        'UAE' => array(
            'adb' => 'Abu Dhabi',
            'dub' => 'Dubai'
        )
    )
));


$form->addElement('select', 'city2', array(
    'label' => 'Flat City List',
    'multiOptions' => array(
        'ptr' => 'Petra',
        'amm' => 'Amman',
        'adb' => 'Abu Dhabi',
        'dub' => 'Dubai'
    )
));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜