/** * * * @param FilterResponseEvent $event */ public function onRenderOembedAdminProductDetailEditBefore(FilterResponseEvent $event) { $request = $event->getRequest(); $response = $event->getResponse(); $parts_btn = $this->app->renderView('Oembed/Resource/template/admin/embed-button.twig', array()); $parts_modal = $this->app->renderView('Oembed/Resource/template/admin/embed-modal.twig', array()); $crawler = new HtmlPageCrawler($response->getContent()); $crawler->filter('#admin_product_free_area')->before($parts_btn); $crawler->filter('body')->append($parts_modal); // $html = $this->getHtml($crawler); $html = $crawler->html(); $html = html_entity_decode($html, ENT_NOQUOTES, 'UTF-8'); $response->setContent($html); $event->setResponse($response); }