mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-04 22:47:21 +00:00
added the possibility to pass a TemplateWrapper to Twig\Environment::load()
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
* 1.38.0 (2019-XX-XX)
|
||||
|
||||
* added the possibility to pass a TemplateWrapper to Twig\Environment::load()
|
||||
* improved the performance of the sandbox
|
||||
* added a spaceless filter
|
||||
* added max value to the "random" function
|
||||
|
||||
+6
-6
@@ -371,8 +371,8 @@ class Environment
|
||||
/**
|
||||
* Renders a template.
|
||||
*
|
||||
* @param string $name The template name
|
||||
* @param array $context An array of parameters to pass to the template
|
||||
* @param string|TemplateWrapper $name The template name
|
||||
* @param array $context An array of parameters to pass to the template
|
||||
*
|
||||
* @return string The rendered template
|
||||
*
|
||||
@@ -382,14 +382,14 @@ class Environment
|
||||
*/
|
||||
public function render($name, array $context = [])
|
||||
{
|
||||
return $this->loadTemplate($name)->render($context);
|
||||
return $this->load($name)->render($context);
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a template.
|
||||
*
|
||||
* @param string $name The template name
|
||||
* @param array $context An array of parameters to pass to the template
|
||||
* @param string|TemplateWrapper $name The template name
|
||||
* @param array $context An array of parameters to pass to the template
|
||||
*
|
||||
* @throws LoaderError When the template cannot be found
|
||||
* @throws SyntaxError When an error occurred during compilation
|
||||
@@ -397,7 +397,7 @@ class Environment
|
||||
*/
|
||||
public function display($name, array $context = [])
|
||||
{
|
||||
$this->loadTemplate($name)->display($context);
|
||||
$this->load($name)->display($context);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user