3 namespace DrupalCodeGenerator\Helper;
5 use Symfony\Component\Console\Helper\Helper;
9 * Output dumper form generators.
11 class Renderer extends Helper {
14 * The twig environment.
16 * @var \Twig_Environment
21 * Constructs a generator command.
23 * @param \Twig_Environment $twig
24 * The twig environment.
26 public function __construct(Twig_Environment $twig) {
33 public function getName() {
34 return 'dcg_renderer';
40 * @param string $template
46 * A string representing the rendered output.
48 public function render($template, array $vars) {
49 return $this->twig->render($template, $vars);
53 * Adds a path where templates are stored.
56 * A path where to look for templates.
58 public function addPath($path) {
59 return $this->twig->getLoader()->addPath($path);