I’m using the following code:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'users-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
'first_name',
'last_name',
'phone',
'email',
array(
'name' => 'Test',
'value' => array($this, 'gridDataColumn'),
),
array(
'class'=>'CButtonColumn',
),
),
)); ?>
I want one of the columns to pull the data from a controller method (see docs: http://www.yiiframework.com/wiki/278/cgridview-render-customized-complex-datacolumns/) but I’m getting this error:
Property "Users.Test" is not defined.
‘Users’ is the name of my model. It works if I add a property to ‘Users’ or if I use a property already existing on users, but I’d like to add a column generated on the fly using the data from the row (ie I don’t want to add a property to my model)