DropDownList: create and update function


I created a model and controller with CRUD operations.

I modified _form.php adding a dropDownList instead of textField:

<?php echo $form->dropDownList($model, 'categoria',array(




)); ?>

It appears fine when I use the “create” action but when I take a look at the DB, the stored string is just “label” (instead of privato, azienda or installatore) and if I try the “update” action, the data doesn’t appear like it should be, of course.

How can I work out it?


try this:

<?php echo $form->dropDownList($model, 'categoria',array(




)); ?>