/**
  * Creates a new EducationalInstitution model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new EducationalInstitution();
     $imagesModel = new Image();
     if ($model->load(Yii::$app->request->post())) {
         if ($model->save()) {
             $imagesModel->image_file = UploadedFile::getInstance($imagesModel, 'image_file');
             if ($imagesModel->image_file) {
                 $imagesModel->saveSchoolImage($model->id, 850, 400);
             }
             return $this->redirect(['view', 'id' => $model->id]);
         } else {
             return $this->render('create', ['model' => $model, 'imagesModel' => $imagesModel]);
         }
     } else {
         return $this->render('create', ['model' => $model, 'imagesModel' => $imagesModel]);
     }
 }