public function edit($record, $fieldprefix, $mode) { $page = $this->getOwnerInstance()->getPage(); $id = $this->getHtmlId($fieldprefix); // register CKEditor main script $page->register_script(Config::getGlobal('assets_url') . 'lib/ckeditor/ckeditor.js'); // activate CKEditor $options = json_encode($this->ckOptions); $page->register_loadscript("CKEDITOR.replace('{$id}', {$options});"); return parent::edit($record, $fieldprefix, $mode); }