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