merged branch jfsimon/issue-7373 (PR #7375)
This PR was merged into the master branch.
Commits
-------
82aa135 [TwigBundle] added conditions for routing & httpkernel extensions
ad5eb7e
[TwigBundle] fixed compiler pass error
Discussion
----------
Issue 7373
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #7373
This commit is contained in:
commit
5ae0c82b55
@ -27,8 +27,16 @@ class ExtensionPass implements CompilerPassInterface
|
|||||||
$container->getDefinition('twig.loader')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
|
$container->getDefinition('twig.loader')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $container->has('translator')) {
|
if ($container->has('translator')) {
|
||||||
$container->getDefinition('twig.extension.trans')->addTag('twig.extension');
|
$container->getDefinition('twig.extension.trans')->addTag('twig.extension');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($container->has('router')) {
|
||||||
|
$container->getDefinition('twig.extension.routing')->addTag('twig.extension');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($container->has('fragment.handler')) {
|
||||||
|
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,6 @@
|
|||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="twig.extension.routing" class="%twig.extension.routing.class%" public="false">
|
<service id="twig.extension.routing" class="%twig.extension.routing.class%" public="false">
|
||||||
<tag name="twig.extension" />
|
|
||||||
<argument type="service" id="router" />
|
<argument type="service" id="router" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
@ -88,7 +87,6 @@
|
|||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service id="twig.extension.httpkernel" class="%twig.extension.httpkernel.class%" public="false">
|
<service id="twig.extension.httpkernel" class="%twig.extension.httpkernel.class%" public="false">
|
||||||
<tag name="twig.extension" />
|
|
||||||
<argument type="service" id="fragment.handler" />
|
<argument type="service" id="fragment.handler" />
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user