I’m very new to the Yii framework but i’ve been loving it so far.
I have 3 tables i’ve created relational model with.(customer, sales_rep, commissions)
I have my index view i changed to use CGridView.
I’m need to concatenate 2 values(first_name, last_name) from the customer model in the commissions index view.
Here’s my actionIndex method
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Commissions');
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
Thanks for the replies. They’ve given me some ideas to try.
One of the problems i’m running into here is i’m trying to access an attribute from another model(i’ve got relations set up).
@Da:Sourcerer When i try your suggestion i get Undefined variable: data when i use $dataProvider instead i get "Property "CActiveDataProvider.first_name" is not defined."
I’ve also tried $model->customer->first_name but that throws the error "Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/html/yii/framework/base/CComponent.php(619) : eval()'d code on line 1 Call Stack: "
@Mindphyre: thank you very much for posting back your solution. I needed exactly this and I am happy I found this post. People like you make me like Yii even more! Thank you again.