Yii Loadmodel

public function actionUpdate($id)

{


$umodel	=	User::model()->findByPk($this->id); 


	$model=$this->loadModel($id);


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


	{


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


		if($model->save())


		Yii::app()->user->setFlash('success',Yii::t('update','UPDATED_SUCCESSFULLY'));


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


			return $model;


	}





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


		'model'=>$model,'umadel'=>$umodel


	));


	


}

What the heck is that? :blink:




echo 'Welcome to the forum.';


if ($question+$code){

    echo $answer

}




(If you will post a question and not only the code, be sure you will receive an answer.)

Parse error: syntax error :P

$question = 0;

$code = 1;

but $question+$code = 1;

;)

Anyway, maybe this is what is needed:


public function loadModel($id)

{

    $model = Category::model()->findByPk($id);

    if ($model===null) {

        throw new CHttpException(404, 'The requested page does not exist.');

    }

    return $model;

}

(this is standard Gii code)