/** * Creates a new Termgeneral model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Termgeneral(); if ($model->load(Yii::$app->request->post())) { $model->image = UploadedFile::getInstance($model, 'image'); $data = $this->saveimage(file_get_contents($model->image->tempName)); $model->ISI_TERM = $data; $model->save(); return $this->redirect(['index']); } else { return $this->renderAjax('create', ['model' => $model]); } }