[Yii]CDetailView: Display name from other model in view


Riazul Karim Ivan

In my previous post: i explain how to display name from other model when i have the ID in that model only.

Previous post link is: Click

Now if i want to show the name in view page also then i just have to call that function only.

<?php $this->widget(‘zii.widgets.CDetailView’, array(
‘data’=>$model,
‘attributes’=>array(
‘id’,
‘main_id’,
array(
‘name’=>’main_id’,
‘value’=>CategoryGroupMain::model()->catMainGetName($model->main_id),
),
‘name’,
),
)); ?>

I just add the value parameter  and use that function.

View original post

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s