Commit f480b609 authored by Fabien Potencier's avatar Fabien Potencier

tweaked previous commit (closes #219)

parent c2d55598
......@@ -48,18 +48,19 @@ The UrlGenerator provider provides a ``url_generator`` service::
'<a href="'.$app['url_generator']->generate('hello', array('name' => 'Igor')).'">Hello Igor</a>';
});
When using Twig, the service can be used like this::
When using Twig, the service can be used like this:
.. code-block:: jinja
{{ app.url_generator.generate('homepage') }}
Moreover, if you register the ``SymfonyBridgesServiceProvider``, then you will have access to the native Twig helpers: ``path()`` and ``url()``::
Moreover, if you register the ``SymfonyBridgesServiceProvider``, then you will
have access to the ``path()`` and ``url()`` functions:
.. code-block:: jinja
{{ path('homepage') }}
{{ url('homepage') }} {# generates the absolute url http://example.org/ #}
You can find more information about this subject in the :doc:`Symfony bridges documentation<symfony_bridges>`.
\ No newline at end of file
You can find more information about this subject in the :doc:`Symfony bridges
documentation <symfony_bridges>`.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment