/**
  * Creates a new Group model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     // if(Yii::$app->request->isAjax) {
     $model = new Group();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         GroupSemesters::createSemestersForGroup($model->getPrimaryKey(), Yii::$app->request->post()['sem_count'], Yii::$app->request->post()['begin_year']);
         return $this->redirect(['manage']);
     } else {
         return $this->renderAjax('create', ['model' => $model]);
     }
     //}
     // else {
     //      throw new NotFoundHttpException('Страница не существует.');
     // }
 }