for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Zenstruck\ControllerUtil\EventListener;
use Zenstruck\ControllerUtil\View;
/**
* @author Kevin Bond <[email protected]>
*/
class TwigViewListener extends ViewListener
{
protected $twig;
public function __construct(\Twig_Environment $twig)
$this->twig = $twig;
}
* {@inheritdoc}
protected function getContent(View $view, $format)
$template = $this->twig->resolveTemplate($view->getTemplate());
return $template->render($view->getDataAsArray());
protected function supports(View $view, $format)
return null !== $view->getTemplate();