/** * Renders the widget. */ public function run() { // if there is no renderTo id, build the layer with current id and initialize renderTo option if (!isset($this->options['chart']) || !isset($this->options['chart']['renderTo'])) { echo WhHtml::tag('div', $this->htmlOptions); if (isset($this->pluginOptions['chart']) && is_array($this->pluginOptions['chart'])) { $this->pluginOptions['chart']['renderTo'] = $this->htmlOptions['id']; } else { $this->pluginOptions['chart'] = array('renderTo' => $this->htmlOptions['id']); } } $this->registerClientScript(); }
/** * Renders field */ public function renderField() { list($name, $id) = $this->resolveNameID(); $this->htmlOptions = WhHtml::defaultOption('id', $id, $this->htmlOptions); $this->htmlOptions = WhHtml::defaultOption('name', $name, $this->htmlOptions); $tagOptions = $this->htmlOptions; $tagOptions['id'] = 'aceEditor_' . $tagOptions['id']; echo WhHtml::tag('div', $tagOptions); $this->htmlOptions['style'] = 'display:none'; if ($this->hasModel()) { echo WhHtml::activeTextArea($this->model, $this->attribute, $this->htmlOptions); } else { echo WhHtml::textArea($name, $this->value, $this->htmlOptions); } $this->htmlOptions = $tagOptions; }