Skip to content

Commit

Permalink
added an absolute_url() Twig function
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Jan 5, 2015
1 parent 2bab326 commit e91965a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DependencyInjection/Compiler/ExtensionPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@ public function process(ContainerBuilder $container)
if ($container->has('fragment.handler')) {
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
}

if ($container->has('request_stack')) {
$container->getDefinition('twig.extension.httpfoundation')->addTag('twig.extension');
}
}
}
3 changes: 3 additions & 0 deletions Resources/config/twig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
<argument type="service" id="fragment.handler" />
</service>

<service id="twig.extension.httpfoundation" class="Symfony\Bridge\Twig\Extension\HttpFoundationExtension" public="false">
<argument type="service" id="request_stack" />
</service>

<service id="twig.extension.form" class="%twig.extension.form.class%" public="false">
<argument type="service" id="twig.form.renderer" />
Expand Down

0 comments on commit e91965a

Please sign in to comment.