Exemplo n.º 1
0
 public function actionCreate()
 {
     $model = new Words();
     $categories = WordsCategory::find()->all();
     if ($model->load(\Yii::$app->request->post())) {
         if (!$model->save()) {
             var_dump($model->errors);
         }
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', ['model' => $model, 'categories' => $categories]);
     }
 }