/** * 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); }
/** * {@inheritDoc} */ public function render() { $this->vars['preview_html'] = Post::formatHtml($this->model->content, true); return $this->makePartial('preview'); }
public function onRefreshPreview() { $data = post('Post'); $previewHtml = Post::formatHtml($data['content'], true); return ['preview' => $previewHtml]; }
public function onRefresh() { $content = post($this->formField->getName()); $previewHtml = PostModel::formatHtml($content, true); return ['preview' => $previewHtml]; }