У меня есть 2 модели: Project и User. В проекте:Yii CGridView DataProvider
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
"users"=>array(self::MANY_MANY, 'User',
'projects_users(project_id, user_id)'),
);
}
Я хочу перечислить всех пользователей, которые в реальном проекте, $ модель содержит фактический проект:
<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'user-grid',
'dataProvider'=>$model->users,
'columns'=>array(
'ID',
'username',
'displayname',
'firstname',
'lastname',
'email',
/*
'password',
'isAdmin',
*/
array(
'class'=>'CButtonColumn',
'template'=>'{delete}',
),
),
)); ?>
Unfortuletlly Я получаю сообщение об ошибке:
Fatal error: Call to a member function getData() on a non-object in /var/www/vhosts/aevers.com/editor/framework/zii/widgets/CBaseListView.php on line 107