Yii relations cgridview -
i using yii user management along tables. relation between user , profile table per extension. using table called reservation contains user_id foreign key reference id field in user table. relation user table named user.
in admin.php of reservation controller want display first name stored in profile table.
my query how can display firstname of profiles table in gridview using $model->search() of reservation model.
code being used :
array( 'header'=>'user', 'name'=>'user_id', 'value'=>'$data->user->username', ),
user model related profile model using profile relations
so try this
array( 'header'=>'user', 'name'=>'user_id', 'value'=>'$data->user->profile->first_name', ),
Comments
Post a Comment