Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Access Model Attribute With Two Relation.

$
0
0
I have a problem while sorting model attribute that we are displaying with two relations.
$sort = new CSort;

$sort->attributes = array(
'c_name'=>array(
'asc' => 'client.name',
'desc' => 'client.name DESC'
),
),'*',
);

return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
'sort'=>$sort,
));

this works fine it has only one relation client.

but when i have two relation,
'project_name'=>array(
'asc' => 'Subscription.project.p_name',
'desc' => 'Subscription.project.p_name DESC'
),'*',

where Subscription and project are relations.How can i do this one??

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>