/**
  * Metodo que faz o processo de cadastro ou atualizacao de dados
  * @return \yii\web\Response
  */
 protected function saveFormData()
 {
     try {
         if (!$this->model->save()) {
             throw new Exception(Yii::t('common', 'There was an error saving the record. Details: {error}', ['error' => $this->model->getErrorsToString()]));
         }
         $this->getSession()->setFlash('growl', ['type' => 'success', 'title' => Yii::t('common', 'All right!'), 'message' => Yii::t('common', 'Your data has been successfully saved!')]);
         if (!is_null($this->getRequest()->post('save-and-continue'))) {
             return $this->refresh();
         } else {
             return $this->redirect(['index']);
         }
     } catch (Exception $e) {
         $errorText = Yii::t('common', 'Oppss... Error!');
         $this->getSession()->setFlash('error', '<strong style="font-size: 1.5em">' . $errorText . '</strong>' . $e->getMessage());
         return $this->redirect([$this->action->id]);
     }
 }