Yii - How to get a values array from an Active Record

前端 未结 9 2606
北荒
北荒 2021-02-15 13:12

Using Yii, how can I get an array from an Active Record.

Say something like this:

array(\'foo\', \'bar\', \'lala\')

From something like thi

9条回答
  •  迷失自我
    2021-02-15 13:24

    if you are using Yii1.1 and you need to get ALL data from AR as array you need to care about that it self. Yii1.1 AR doesn't have this feature out of the box

    In Yii2 AR has asArray() method, it's very helpful

    I hope my answer helps someone

提交回复
热议问题