|
|
|
@ -33,9 +33,14 @@ class Twig extends Handler
|
|
|
|
|
$this->templateVariables = array_merge($this->templateVariables, $variables);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function template($template, $variables) {
|
|
|
|
|
public function template($template, $variables = [], $useGlobalVariables = true) {
|
|
|
|
|
$stream = new TwigStream($this->environment);
|
|
|
|
|
$stream->setTemplate($template);
|
|
|
|
|
|
|
|
|
|
if ($useGlobalVariables) {
|
|
|
|
|
$stream->appendVariables($this->container->get('twig.globals'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$stream->appendVariables($this->templateVariables);
|
|
|
|
|
$stream->appendVariables($variables);
|
|
|
|
|
|
|
|
|
|