/** * @param $text * @return string */ public function run($text) { $args = new ContentEditorArgs(); $args->setValue($text); $this->eventManager->dispatchEvent(ContentEditorEvents::onContentEditorRender, $args); return $args->getValue(); }
public function getValue() { $args = new ContentEditorArgs(); $args->setValue(parent::getValue()); $this->eventManager->dispatchEvent(ContentEditorEvents::onContentEditorSave, $args); $value = $args->getValue(); return $value; }
public function onContentEditorRender(ContentEditorArgs $args) { $value = $args->getValue(); $presenter = $this->context->application->getPresenter(); $snippetMode = $presenter->snippetMode; $presenter->snippetMode = NULL; $template = $presenter->createTemplate('Nette\\Templating\\Template'); $template->setSource($value); $args->setValue($template->__toString()); $presenter->snippetMode = $snippetMode; }