Using Yii, how can I get an array from an Active Record.
Say something like this:
array(\'foo\', \'bar\', \'lala\')
From something like thi
If i understand you correctly:
$users = User::model()->findAll(); $usersArr = CHtml::listData( $users, 'id' , 'name'); print_r( $usersArr );
It will give you array id => name
Array { 2 => 'someone', 20 => 'kitty', 102 => 'Marian', // ... }