How can I convert the result of Trips::model()->findAll() to an array?
Trips::model()->findAll()
Use simply:
$trips = Trips::model()->findAll(); $trips_array = CJSON::decode(CJSON::encode($trips));
Note: This is not good way but returns array
i use $array = CJSON::decode(CJSON::encode($model)); to convert $model to $array.
$array = CJSON::decode(CJSON::encode($model));