radioButtonList checked by default

yii

Solution

You have to set `$model->active = 1` in your controller.

Problem

I created a option list with 2 options: Yes and No like below ``` <?php echo $form->radioButtonList($model,'active', array(1=>'Yes', 0=>'No'), array('separator'=>"" )); ?> ``` How can I set option 1 to be selected by default ?

Original source