コード例 #1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate()
 {
     $model = new Volunteer();
     if (isset($_POST['Volunteer'])) {
         $model->attributes = $_POST['Volunteer'];
         if ($model->save()) {
             Yii::app()->user->setFlash('success', '创建成功');
             $this->redirect(array('update', 'id' => $model->id));
         }
     }
     $this->render('create', array('model' => $model));
 }