Yii Framework Forum: Undefined Variable: Issuedataprovider - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Undefined Variable: Issuedataprovider

#1 User is offline   rombo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 12-May 14

Posted 12 May 2014 - 02:04 AM

I m working studying Web Application Development With Yii And PHP and have the following problem
Undefined variable: issueDataProvider
I have attached the screenshots below, help on this would be greatly appreciated.
Attached File  Screenshot from 2014-05-12 09:59:50.png (96.26K)
Number of downloads: 4
Attached File  Screenshot from 2014-05-12 10:00:04.png (128.27K)
Number of downloads: 4
0

#2 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 494
  • Joined: 08-October 12
  • Location:Austria

Posted 12 May 2014 - 02:19 AM

You have not altered action view method

you have not passed issuedateprovider :)

Just copy below code.. it should work


/**
* Displays a particular model.
*/
public function actionView()
{
$issueDataProvider=new CActiveDataProvider('Issue', array(
'criteria'=>array(
'condition'=>'project_id=:projectId',
'params'=>array(':projectId'=>$this->loadModel()->id),
),
'pagination'=>array(
'pageSize'=>1,
),
));
$this->render('view',array(
'model'=>$this->loadModel(),
'issueDataProvider'=>$issueDataProvider,
));
}


Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#3 User is offline   rombo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 12-May 14

Posted 12 May 2014 - 02:52 AM

View Postchandran, on 12 May 2014 - 02:19 AM, said:

You have not altered action view method

you have not passed issuedateprovider :)

Just copy below code.. it should work


/**
* Displays a particular model.
*/
public function actionView()
{
$issueDataProvider=new CActiveDataProvider('Issue', array(
'criteria'=>array(
'condition'=>'project_id=:projectId',
'params'=>array(':projectId'=>$this->loadModel()->id),
),
'pagination'=>array(
'pageSize'=>1,
),
));
$this->render('view',array(
'model'=>$this->loadModel(),
'issueDataProvider'=>$issueDataProvider,
));
}



i have changed the code as you have mentioned above but it's still showing the same error
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users