Skip to content

Commit

Permalink
[TwigBridge] Use reflection to get guess the file path for form resou…
Browse files Browse the repository at this point in the history
…rces fixes #3093
  • Loading branch information
henrikbjorn committed Jan 12, 2012
1 parent fa1c946 commit 348a3c6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public function load(array $configs, ContainerBuilder $container)
$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');
Expand Down

0 comments on commit 348a3c6

Please sign in to comment.