made Symfony compatible with both Twig 1.x and 2.x
This commit is contained in:
parent
cc73e19175
commit
4de4180457
@ -19,12 +19,12 @@ if (!class_exists('Twig_Environment')) {
|
|||||||
} else {
|
} else {
|
||||||
class StubFilesystemLoader extends \Twig_Loader_Filesystem
|
class StubFilesystemLoader extends \Twig_Loader_Filesystem
|
||||||
{
|
{
|
||||||
protected function findTemplate($name)
|
protected function findTemplate($name, $throw = true)
|
||||||
{
|
{
|
||||||
// strip away bundle name
|
// strip away bundle name
|
||||||
$parts = explode(':', $name);
|
$parts = explode(':', $name);
|
||||||
|
|
||||||
return parent::findTemplate(end($parts));
|
return parent::findTemplate(end($parts), $throw);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
|
|||||||
*
|
*
|
||||||
* @throws \Twig_Error_Loader if the template could not be found
|
* @throws \Twig_Error_Loader if the template could not be found
|
||||||
*/
|
*/
|
||||||
protected function findTemplate($template)
|
protected function findTemplate($template, $throw = true)
|
||||||
{
|
{
|
||||||
$logicalName = (string) $template;
|
$logicalName = (string) $template;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user