Yii1 AR model select associative array

Just a quick snippet on preparing models into assoc array:

$users = User::model()->findAll();
$usersArr = CHtml::listData( $users, 'id' , 'name');
var_dump($usersArr);
Click to rate this post!
[Total: 0 Average: 0]

You May Also Like

About the Author: deniskoronets

Leave a Reply

Your email address will not be published. Required fields are marked *