For recording different ‘aktif’ variables(0 or 1) to mysql.
Aktif is not static data it is dynamica data which is 0 or 1 . If user selects aktif 0 from form it comes 0 but if i want to assign model->attributes to POST attributes, it is always 1. I don’t understand this situation.
return array(
array('genislik, yukseklik, metin, aktif', 'required'),
array('id, site_id, genislik, yukseklik, aktif', 'numerical', 'integerOnly'=>true),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, site_id, genislik, yukseklik, metin, aktif', 'safe', 'on'=>'search'),
);
Will you explain your problem a bit more comprehensively.As far as I can gather,You have an attribute named ‘atkif’ which is a tinyint and you need to save it in your model.
FIrst of all Use a checkbox which will be better than a dropdownlist.Secondly,if it is a model attribute then $model->attribute=$_POST[‘FormName’] should work.If not set separately, using $model->atkif=$_POST[‘FormName’][‘field name’].