public function newCorpus() { try { $model = new Corpus(); $this->data->corpus->entry = 'crp_' . strtolower(str_replace('crp_', '', $this->data->corpus->entry)); $model->setData($this->data->corpus); $model->save($this->data->corpus); $this->renderPrompt('information', 'OK', "structure.editEntry('{$this->data->corpus->entry}');"); } catch (\Exception $e) { $this->renderPrompt('error', $e->getMessage()); } }