formatHtml() public static method

public static formatHtml ( $input, $preview = false )
Exemplo n.º 1
0
 /**
  * Returns an array of translated values for this field
  * @return array
  */
 public function getSaveValue($value)
 {
     $localeData = $this->getLocaleSaveData();
     /*
      * Set the translated values to the model
      */
     if ($this->model->methodExists('setTranslateAttribute')) {
         foreach ($localeData as $locale => $value) {
             $this->model->setTranslateAttribute('content', $value, $locale);
             $this->model->setTranslateAttribute('content_html', Post::formatHtml($value), $locale);
         }
     }
     return array_get($localeData, $this->defaultLocale->code, $value);
 }
Exemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function render()
 {
     $this->vars['preview_html'] = Post::formatHtml($this->model->content, true);
     return $this->makePartial('preview');
 }
Exemplo n.º 3
0
 public function onRefreshPreview()
 {
     $data = post('Post');
     $previewHtml = Post::formatHtml($data['content'], true);
     return ['preview' => $previewHtml];
 }
Exemplo n.º 4
0
 public function onRefresh()
 {
     $content = post($this->formField->getName());
     $previewHtml = PostModel::formatHtml($content, true);
     return ['preview' => $previewHtml];
 }