예제 #1
0
 /**
  * Creates a new Channel model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Channel();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
예제 #2
0
 public function actionCreate()
 {
     $model = new Channel();
     if ($model->load($_POST) && $model->save()) {
         CacheUtility::createChannelCache();
         return $this->redirect(['index']);
     } else {
         $locals = [];
         $locals['model'] = $model;
         $locals['tableList'] = CommonUtility::getTables();
         $locals['channelTpls'] = $this->getTpl('channel_');
         $locals['listTpls'] = $this->getTpl('list_');
         $locals['detailTpls'] = $this->getTpl('detail_');
         return $this->render('create', $locals);
     }
 }