Skip to content

Commit 061bc3f

Browse files
[TwigBridge] Add new Twig bridge function to generate impersonation path
1 parent cda7c1a commit 061bc3f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

reference/twig_reference.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,41 @@ expression
286286
Creates an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` related
287287
to the :doc:`ExpressionLanguage component </components/expression_language>`.
288288

289+
impersonation_path
290+
~~~~~~~~~~~~~~~~~~
291+
292+
.. code-block:: twig
293+
294+
{{ impersonation_path(identifier) }}
295+
296+
``identifier``
297+
**type**: ``string``
298+
299+
Generates a URL that you can visit to
300+
:doc:`impersonate a user </security/impersonating_user>`, identified by the
301+
``identifier`` argument.
302+
303+
.. versionadded:: 6.4
304+
305+
The ``impersonation_path()`` function was introduced in Symfony 6.4.
306+
307+
impersonation_url
308+
~~~~~~~~~~~~~~~~~~
309+
310+
.. code-block:: twig
311+
312+
{{ impersonation_url(identifier) }}
313+
314+
``identifier``
315+
**type**: ``string``
316+
317+
It's similar to the `impersonation_path`_ function, but it generates
318+
absolute URLs instead of relative URLs.
319+
320+
.. versionadded:: 6.4
321+
322+
The ``impersonation_url()`` function was introduced in Symfony 6.4.
323+
289324
impersonation_exit_path
290325
~~~~~~~~~~~~~~~~~~~~~~~
291326

0 commit comments

Comments
 (0)