Ch#6 , Page#118

Hello Yii,

I am working in my localhost environment:

XAMPP

PHP version 5.3.8

PHPmyadmin (MySQL) version 5.0.8

My webroot directory is:

C:\XAMPP\htdocs\

And my base directory for the MyProject site is:

C:\XAMPP\htdocs\YII\MyProject

In page#118:

public function actionCreate()

{

$model=new Issue;

$model->project_id = $this->_project->id;

and i got error message. it says:

In issueController.php




public function actionCreate()

	{

		$model=new Issue;

                $model->project_id= $this->_project->id;


		// Uncomment the following line if AJAX validation is needed

		// $this->performAjaxValidation($model);


		if(isset($_POST['Issue']))

		{

			$model->attributes=$_POST['Issue'];

			if($model->save())

				$this->redirect(array('view','id'=>$model->id));

		}


		$this->render('create',array(

			'model'=>$model,

		));

	}



Does anyone have any ideas or suggestions and how to solve the problem?

Thanks

Best Wishes,

Adnan

In my controller this actcion is as follow


public function actionAdmin()

	{

		$model=new Issue('search');

		$model->unsetAttributes();  // clear any default values

		if(isset($_GET['Issue']))

			$model->attributes=$_GET['Issue'];

		

		$model->project_id = $this->_project->id;

		

		$this->render('admin',array(

			'model'=>$model,

		));

	}

Try it.

it is working well but the book did not say that!!! i want create function…not admin function.

I think that code that I copy you is default. I remember, I only change small things.