public function render(Modal $modal, $template = 'EkynaCoreBundle:Modal:modal.xml.twig')
    {
        $response = new Response();

        // Translations
        $modal->setTitle($this->translator->trans($modal->getTitle()));
        $buttons = $modal->getButtons();
        foreach($buttons as &$button) {
            $button['label'] = $this->translator->trans($button['label']);
        }
        $modal->setButtons($buttons);

        $response->setContent($this->twig->render($template, ['modal' => $modal]));

        $response->headers->add(['Content-Type' => 'application/xml; charset='.strtolower($this->charset)]);

        return $response;
    }
public function render(Modal $modal, $template = 'EkynaCoreBundle:Modal:modal.xml.twig')
    {
        $response = new Response();

        // Translations
        $modal->setTitle($this->translator->trans($modal->getTitle()));
        $buttons = $modal->getButtons();
        foreach($buttons as &$button) {
            $button['label'] = $this->translator->trans($button['label']);
        }
        $modal->setButtons($buttons);

        $response->setContent($this->twig->render($template, ['modal' => $modal]));

        $response->headers->add(['Content-Type' => 'application/xml; charset='.strtolower($this->charset)]);

        return $response;
    }
public function render ( Modal $ modal , $ template = 'EkynaCoreBundle:Modal:modal.xml.twig' ) { $ response = new Response ( ) ; // Translations $ modal -> setTitle ( $ this -> translator -> trans ( $ modal -> getTitle ( ) ) ) ; $ buttons = $ modal -> getButtons ( ) ; foreach ( $ buttons as & $ button ) { $ button [ 'label' ] = $ this -> translator -> trans ( $ button [ 'label' ] ) ; } $ modal -> setButtons ( $ buttons ) ; $ response -> setContent ( $ this -> twig -> render ( $ template , [ 'modal' => $ modal ] ) ) ; $ response -> headers -> add ( [ 'Content-Type' => 'application/xml; charset=' . strtolower ( $ this -> charset ) ] ) ; return $ response ; }
Renders and returns the modal response.

@param Modal $modal
@param string $template
@return Response
Renders and returns the modal response .