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