merged branch henrikbjorn/twig-bridge-resources (PR #3099)
Commits
-------
348a3c6
[TwigBridge] Use reflection to get guess the file path for form resources fixes #3093
Discussion
----------
[TwigBridge] Use reflection to guess the file path for form resources
Fixes #3093
This commit is contained in:
commit
6b4e4d95d9
@ -42,7 +42,9 @@ class TwigExtension extends Extension
|
||||
$container->setParameter('twig.exception_listener.controller', $config['exception_controller']);
|
||||
|
||||
$container->setParameter('twig.form.resources', $config['form']['resources']);
|
||||
$container->getDefinition('twig.loader')->addMethodCall('addPath', array(__DIR__.'/../../../Bridge/Twig/Resources/views/Form'));
|
||||
|
||||
$reflClass = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
|
||||
$container->getDefinition('twig.loader')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())) . '/Resources/views/Form'));
|
||||
|
||||
if (!empty($config['globals'])) {
|
||||
$def = $container->getDefinition('twig');
|
||||
|
Reference in New Issue
Block a user