public function replaceShortcodesAction() { $description = $this->getRequest()->request->get('description'); $event = new DiaporamaHtmlEvent(); $event->setEntityDescription($description); $this->dispatch(DiaporamaEvents::DIAPORAMA_PARSE, $event); return new Response($event->getEntityDescription()); }
public function filter($tpl_output, $smarty) { // Are we front or back? if ($this->parser->getTemplateDefinition()->getType() == TemplateDefinition::FRONT_OFFICE) { $event = new DiaporamaHtmlEvent(); $event->setEntityDescription($tpl_output); $event->setDispatcher($this->dispatcher); $this->dispatcher->dispatch(DiaporamaEvents::DIAPORAMA_PARSE_FRONT, $event); return $event->getEntityDescription(); } else { return $tpl_output; } }
/** * Parsing a description, in order to replace shortcodes with their HTML codes * @param DiaporamaEvent $event */ public function parseDiaporamaDescription(DiaporamaHtmlEvent $event) { $event->setEntityDescription($this->updateDescription($event->getEntityDescription())); }