2011-03-24 06:46:39 0 评论 Yii 1.0 Boy.Lee

Yii 1.0 $_POST消失

code first ^&^

	public function actionUpdate($id)
	{
		$model=$this->loadModel($id);

		// Uncomment the following line if AJAX validation is needed
		// $this->performAjaxValidation($model);

		if(isset($_POST['Version']))
		{
                        //the value does not show here.??
                        print_r($_POST);
			$model->attributes=$_POST['Version'];
			if($model->save())
				$this->redirect(array('update','id'=>$model->id));
		}

		$this->render('update',array(
			'model'=>$model,
		));
	}

EN : the print_r($_POST),

因为redirect的原因,print_r($_POST)不会显示任何值,即使指向相同的action。

A stupid mistake ^&^ ~~