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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -