for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the sauls/widget package.
*
* @author Saulius Vaičeliūnas <[email protected]>
* @link http://saulius.vaiceliunas.lt
* @copyright 2018
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sauls\Component\Widget\View;
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
class TwigView implements ViewInterface
{
private Environment $twig;
public function __construct(Environment $twig)
$this->twig = $twig;
}
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
public function render(string $viewFile, array $viewData = []): string
return $this->twig->render($viewFile, $viewData);
public function getName(): string
return 'twig';