Yii Framework Forum: Unable to see the Issue - Yii Framework Forum

Jump to content

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

Unable to see the Issue

#1 User is offline   V Srinivasa Raju 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 11-January 11
  • Location:Visakhapatnam, India

Posted 21 March 2011 - 08:20 AM

I have been practicing the Yii Book Track star Application and as per the guidelines of the book i have created everything and it went on well . But i am unable to see the issues and i am getting the below problem while seeing the hyperlink

http://localhost/ani...oject/view&id=1
Description

Missing argument 1 for ProjectController::loadModel(), called in D:\wamp\www\anits\protected\controllers\ProjectController.php on line 65 and defined

Source File

D:\wamp\www\anits\protected\controllers\ProjectController.php(174)

00162: $model->attributes=$_GET['Project'];
00163:
00164: $this->render('admin',array(
00165: 'model'=>$model,
00166: ));
00167: }
00168:
00169: /**
00170: * Returns the data model based on the primary key given in the GET variable.
00171: * If the data model is not found, an HTTP exception will be raised.
00172: * @param integer the ID of the model to be loaded
00173: */
00174: public function loadModel($id)
00175: {
00176: $model=Project::model()->findByPk((int)$id);
00177: if($model===null)
00178: throw new CHttpException(404,'The requested page does not exist.');
00179: return $model;
00180: }
00181:
00182: /**
00183: * Performs the AJAX validation.
00184: * @param CModel the model to be validated
00185: */
00186: protected function performAjaxValidation($model)
0

#2 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 21 March 2011 - 08:24 AM

method loadModel accepts 1 argument
it should be
$this->loadModel($id);
--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#3 User is offline   jefftulsa 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 168
  • Joined: 06-October 08
  • Location:Austin, TX

Posted 21 March 2011 - 09:12 PM

Yes, this is just an issue with the differences between the way the code is auto-generated between Yii version 1.1.2 and newer versions. I assume you might be using a version newer than 1.1.2, is that correct? If so, there are some subtle code differences you should keep in mind as you work through the examples in the book.
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