bundles/BlockManagerBundle/EventListener/ViewRendererListener.php
public function onView(GetResponseForControllerResultEvent $event): void
    {
        $view = $event->getControllerResult();
        if (!$view instanceof ViewInterface) {
            return;
        }

        $response = $view->getResponse();
        if (!$response instanceof Response) {
            return;
        }

        $renderedView = '';

        try {
            $renderedView = $this->viewRenderer->renderView($view);
        } catch (Throwable $t) {
            $this->errorHandler->handleError($t);
        }

        $response->setContent($renderedView);

        $event->setResponse($response);
    }
public function onView(GetResponseForControllerResultEvent $event): void
    {
        $view = $event->getControllerResult();
        if (!$view instanceof ViewInterface) {
            return;
        }

        $response = $view->getResponse();
        if (!$response instanceof Response) {
            return;
        }

        $renderedView = '';

        try {
            $renderedView = $this->viewRenderer->renderView($view);
        } catch (Throwable $t) {
            $this->errorHandler->handleError($t);
        }

        $response->setContent($renderedView);

        $event->setResponse($response);
    }
public function onView ( GetResponseForControllerResultEvent $ event ) : void { $ view = $ event -> getControllerResult ( ) ; if ( ! $ view instanceof ViewInterface ) { return ; } $ response = $ view -> getResponse ( ) ; if ( ! $ response instanceof Response ) { return ; } $ renderedView = '' ; try { $ renderedView = $ this -> viewRenderer -> renderView ( $ view ) ; } catch ( Throwable $ t ) { $ this -> errorHandler -> handleError ( $ t ) ; } $ response -> setContent ( $ renderedView ) ; $ event -> setResponse ( $ response ) ; }
Renders the view provided by the event.
Renders the view provided by the event .