language = $this->getConfig('language', 'php'); $this->showGutter = $this->getConfig('showGutter', true); $this->theme = $this->getConfig('theme', 'twilight'); $this->wrapWords = $this->getConfig('wrapWords', false); $this->fontSize = $this->getConfig('fontSize', false); $this->margin = $this->getConfig('margin', 0); } /** * {@inheritDoc} */ public function render() { $this->prepareVars(); return $this->makePartial('codeeditor'); } /** * Prepares the list data */ public function prepareVars() { $this->vars['stretch'] = $this->formField->stretch; $this->vars['size'] = $this->formField->size; $this->vars['language'] = $this->language; $this->vars['showGutter'] = $this->showGutter; $this->vars['wrapWords'] = $this->wrapWords; $this->vars['fontSize'] = $this->fontSize; $this->vars['theme'] = $this->theme; $this->vars['name'] = $this->formField->getName(); $this->vars['value'] = $this->model->{$this->columnName}; $this->vars['margin'] = $this->margin; } /** * {@inheritDoc} */ public function loadAssets() { $this->addCss('css/codeeditor.css'); $this->addJs('vendor/ace/ace.js'); $this->addJs('js/codeeditor.js'); } }