开发者

zend framework - Remove optgroup from select box

开发者 https://www.devze.com 2023-02-24 01:05 出处:网络
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.

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

精彩评论

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

关注公众号