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??
$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??