示例#1
0
 /**
  * Creates a new model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  */
 public function actionCreate($id)
 {
     $model = new Request();
     $mglist = Mglist::model()->findByPk($id);
     $model->list_id = $id;
     // Uncomment the following line if AJAX validation is needed
     $this->performAjaxValidation($model);
     if (isset($_POST['Request'])) {
         $model->mglist_id = $id;
         $model->attributes = $_POST['Request'];
         $model->checksum = 0;
         // unused now - prior rand(100,10000);
         $yg = new Yiigun();
         $model->hash = $yg->generateVerifyHash($model, $mglist);
         $res = $model->save();
         if ($model->save()) {
             $yg->sendVerificationRequest($model, $mglist);
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     $this->render('create', array('id' => $id, 'model' => $model, 'mglist' => $mglist));
 }