Example #1
0
 /**
  * Creates a new Rooms model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Rooms();
     $cat_list = $model->getNameCatAndClass();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         $model->image = UploadedFile::getInstances($model, 'image');
         if ($model->image && $model->multipleUpload()) {
             return $this->redirect(['view', 'id' => $model->id]);
         }
     } else {
         return $this->render('create', ['model' => $model, 'cat_list' => $cat_list]);
     }
 }