Using Yii, how can I get an array from an Active Record.
Say something like this:
array(\'foo\', \'bar\', \'lala\')
From something like thi
Don't use ActiveRecord. Use CDBCommand->queryColumn()
ActiveRecord class has an attribute called attributes. You can find its description here: http://www.yiiframework.com/doc/api/1.1/CActiveRecord#attributes-detail.
In order to get all attributes in an array, use this: $var = $model->attributes;
Use the Yii2 ArrayHelper by including to your controller this will convert a model data to an associated array
use yii\helpers\ArrayHelper;
$post = ArrayHelper::toArray(ClientProfilesForm::findOne(['id' => 1]));
//or use it directly by
$post = yii\helpers\ArrayHelper::toArray(ClientProfilesForm::findOne(['id' => 1]));