<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UpdateAction
 *
 * @author yzxh24
 */
class UpdateAction extends BaseAction
{
    public function run()
    {
        if(!isset($_GET['id']))
        {
            throw new CHttpException(404,'The requested page does not exist.');
		}
        $model = Pmlink::model()->findbyPk($_GET['id']);

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

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