public function onView(GetResponseForControllerResultEvent $event)
    {
        $result = $event->getControllerResult();

        if (!$result instanceof TemplateView) {
            return;
        }

        $response = $this->render($result);

        $event->setResponse($response);
    }