Yii model to array?

前端 未结 14 1963
南笙
南笙 2020-12-08 19:32

How can I convert the result of Trips::model()->findAll() to an array?

14条回答
  •  Happy的楠姐
    2020-12-08 20:15

    This is same.

    $array = CHtml::listData(Trips::model()->findAll(), 'trip_id', 'trip_name');
    

提交回复
热议问题