public function onKernelView(GetResponseForControllerResultEvent $event)
    {
        $request    = $event->getRequest();
        $response   = $event->getResponse();
        $parameters = $event->getControllerResult();

        if (!$response instanceof Response && $template = $request->attributes->get('_template')) {
            return $event->setControllerResult($this->templating->render($template, $parameters));
        }
    }
public function onKernelView(GetResponseForControllerResultEvent $event)
    {
        $request    = $event->getRequest();
        $response   = $event->getResponse();
        $parameters = $event->getControllerResult();

        if (!$response instanceof Response && $template = $request->attributes->get('_template')) {
            return $event->setControllerResult($this->templating->render($template, $parameters));
        }
    }
public function onKernelView ( GetResponseForControllerResultEvent $ event ) { $ request = $ event -> getRequest ( ) ; $ response = $ event -> getResponse ( ) ; $ parameters = $ event -> getControllerResult ( ) ; if ( ! $ response instanceof Response && $ template = $ request -> attributes -> get ( '_template' ) ) { return $ event -> setControllerResult ( $ this -> templating -> render ( $ template , $ parameters ) ) ; } }
Handles Kernel View events

@param GetResponseForControllerResultEvent $event
Handles Kernel View events