/** * Get the content rendered as HTML. * * @return string */ public function getContentHtmlAttribute() { if ($this->is_html) { return nl2br($this->content); } return static::$formatter->render($this->attributes['content'], $this); }
/** * {@inheritdoc} */ protected function getAssets() { $assets = parent::getAssets(); $assets->addJs(function () { return $this->formatter->getJs(); }); return $assets; }
/** * {@inheritdoc} */ public function getView() { $view = parent::getView(); $view->getJs()->addString(function () { return $this->formatter->getJs(); }); return $view; }
/** * Get the content rendered as HTML. * * @param string $value * @return string */ public function getContentHtmlAttribute($value) { return static::$formatter->render($this->attributes['content'], $this); }