Example #1
0
 /**
  * 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);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 protected function getAssets()
 {
     $assets = parent::getAssets();
     $assets->addJs(function () {
         return $this->formatter->getJs();
     });
     return $assets;
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function getView()
 {
     $view = parent::getView();
     $view->getJs()->addString(function () {
         return $this->formatter->getJs();
     });
     return $view;
 }
Example #4
0
 /**
  * Get the content rendered as HTML.
  *
  * @param string $value
  * @return string
  */
 public function getContentHtmlAttribute($value)
 {
     return static::$formatter->render($this->attributes['content'], $this);
 }