[Ask] Dropdownlist Problem

i have some problem with drop down list, i defined value of item directly on dropdownlist form without table relation, when i runing this form and try to select 1 item from that drop downlist and i save it, there is nothing fill in the field in db. can give me help?


 <?php echo $form->dropDownListRow($model,'EMP_RELIGION',array(

             'empty'=>'----- Pilih Agama -----',

             'Islam',

             'Kristen',

             'Katolik',

             'Hindu',

             'Budha',

           )); 

        ?>

Please post this in the Yii 1.x forum. This is a Yii 2.x forum. If your query is for Yii2, you need to use


$form->field($model, 'EMP_RELIGION')->dropDownList($data, $options);

if you are using yii2.0 use below code for dropdrown list




$items = array("1" => "first" , "2" => "second");


<?= $form->field($model, 'cat_id')->DropDownList($items , $options = [])