<?php
/**
 * Descriptions
 * @author yzxh24
 * @email yzxh24@gmail.com
 * @created 2011-11-04 14:09:47
 */
class UpdateAction extends BaseAction
{
    public function run()
    {
        //put your code here
        $id = Yii::app()->request->getQuery('id');
        $model = Task::model()->findByPk($id);

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

		if(isset($_POST['Task']))
		{
			$model->attributes = $_POST['Task'];
			if($model->save())
            {
				$this->getController()->redirect(array('list'));
            }
		}

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