bug #15589 made Symfony compatible with both Twig 1.x and 2.x (fabpot)

This PR was merged into the 2.3 branch.

Discussion
----------

made Symfony compatible with both Twig 1.x and 2.x

Commits
-------

4de4180 made Symfony compatible with both Twig 1.x and 2.x
This commit is contained in:
Fabien Potencier 2015-08-23 20:39:03 +02:00
commit 34bbd126d9
2 changed files with 3 additions and 3 deletions

View File

@ -19,12 +19,12 @@ if (!class_exists('Twig_Environment')) {
} else {
class StubFilesystemLoader extends \Twig_Loader_Filesystem
{
protected function findTemplate($name)
protected function findTemplate($name, $throw = true)
{
// strip away bundle name
$parts = explode(':', $name);
return parent::findTemplate(end($parts));
return parent::findTemplate(end($parts), $throw);
}
}
}

View File

@ -64,7 +64,7 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
*
* @throws \Twig_Error_Loader if the template could not be found
*/
protected function findTemplate($template)
protected function findTemplate($template, $throw = true)
{
$logicalName = (string) $template;