Skip to content

[HttpKernel] Add an helper to generate fragments URL #17621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions reference/twig_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,28 @@ falls back to the behavior of `render`_ otherwise.
in the function name, e.g. ``render_hinclude()`` will use the hinclude.js
strategy. This works for all ``render_*()`` functions.

fragment_uri
~~~~~~~~~~~~

.. code-block:: twig

{{ fragment_uri(controller, absolute = false, strict = true, sign = true) }}

``controller``
**type**: ``ControllerReference``
``absolute`` *(optional)*
**type**: ``boolean`` **default**: ``false``
``strict`` *(optional)*
**type**: ``boolean`` **default**: ``true``
``sign`` *(optional)*
**type**: ``boolean`` **default**: ``true``

Generates the URI of a fragment.

.. versionadded:: 5.3

The ``fragment_uri()`` function was introduced in Symfony 5.3.

controller
~~~~~~~~~~

Expand Down