Drop down list in Yii CActive Form

Values in drop down list called via CActiveForm::dropDownList() is be populated by passing array of value => text as parameter.

Code :

<?php echo $form->dropDownList($form, 'title',
    array('1' => 'Mr', '2' => 'Mrs', '3' => 'Miss'),
    array('empty' => 'Select Title')
); ?>

Leave a Reply

Your email address will not be published. Required fields are marked *