Esempio n. 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);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 protected function getAssets()
 {
     $assets = parent::getAssets();
     $assets->addJs(function () {
         return $this->formatter->getJs();
     });
     return $assets;
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function getView()
 {
     $view = parent::getView();
     $view->getJs()->addString(function () {
         return $this->formatter->getJs();
     });
     return $view;
 }
Esempio n. 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);
 }