Browse Source

merged branch stof/composer_install (PR #4380)

Commits
-------

7a85b43 [TwigBundle] Fixed the path to templates when using composer

Discussion
----------

[TwigBundle] Composer install

When installing the bundle and the bridge from the standalone repositories
the relative path between them is different. This simply backports the
change done in symfony 2.1 to allow using subtree repositories with 2.0.x
too.

---------------------------------------------------------------------------

by travisbot at 2012-05-22T20:54:38Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1404225) (merged 8784dc49 into 836443d6).

---------------------------------------------------------------------------

by travisbot at 2012-05-22T21:01:40Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1404321) (merged 7a85b434 into 836443d6).
Fabien Potencier 13 years ago
parent
commit
6aa4d19213

+ 3 - 1
src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

@@ -55,7 +55,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()))));
 
         if (!empty($config['globals'])) {
             $def = $container->getDefinition('twig');