/** * Creates a new LessonType model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new LessonType(); if ($model->load(Yii::$app->request->post()) && $model->save()) { $searchModel = new LessonTypeSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->renderAjax('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); } else { return $this->renderAjax('create', ['model' => $model]); } }