示例#1
0
 /**
  * Creates a new Videos model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Videos();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->getSession()->setFlash('success', 'Successfully saved.');
         return $this->redirect(['update', 'id' => $model->id]);
     } else {
         $languages = Lang::find()->all();
         $languageDefault = Lang::findOne(['default' => 1]);
         return $this->render('create', ['model' => $model, 'languages' => $languages, 'languageDefault' => $languageDefault]);
     }
 }