public function newRelationType() { try { $model = new RelationType(); $this->data->relationtype->entry = 'rel_' . str_replace('rel_', '', strtolower($this->data->relationtype->entry)); $this->data->relationtype->nameEntity1 = $this->data->relationtype->entry . '_nameentity1'; $this->data->relationtype->nameEntity2 = $this->data->relationtype->entry . '_nameentity2'; $model->setData($this->data->relationtype); $model->save(); $this->renderPrompt('information', 'OK', "structure.editEntry('{$this->data->relationtype->entry}');"); } catch (\Exception $e) { $this->renderPrompt('error', $e->getMessage()); } }