public function renderTwigTemplate(string $name, array $context = [])
    {
        $event = $this->container->get('event_dispatcher')->dispatch(
            RenderTwigTemplateEvent::NAME,
            new RenderTwigTemplateEvent(
                $name, $context
            )
        );

        $buffer = $this->container->get('twig')->render(
            $this->getTemplate($event->getTemplate()),
            $event->getContext()
        );

        return $buffer;
    }