Wednesday, 15 August 2012

php - Generate select without optgroup on dropDownList in Yii -



php - Generate select without optgroup on dropDownList in Yii -

i using dropdownlistrow of bootstrap yii.

<?php echo $form->dropdownlistrow($model, 'roles', array('' => "--select roles--", 'trekking agency' => chtml::listdata(roles::model()->findall(), 'idrole', 'name'))); ?>

it renders select within optgroup. not want options in optgroup. way remove optgroup select in yii?

it looks using listdata within array , array has element, optgroups created if have array within array structure. creating empty options utilize empty htmloptions attribute below (see here details)

<?php echo $form->dropdownlistrow($model, 'roles', chtml::listdata(roles::model()->findall(), 'idrole', 'name'), array('empty'=>'--select roles---')); ?>

php html yii

No comments:

Post a Comment