Skip to content

Commit

Permalink
minor symfony#18966 Add new Twig bridge function to generate imperson…
Browse files Browse the repository at this point in the history
…ation path (alexandre-daubois)

This PR was merged into the 6.4 branch.

Discussion
----------

Add new Twig bridge function to generate impersonation path

Fix
- symfony#18960

Fix
- symfony#18968

However, I think we should wait for this PR to be merged (or not), because it seems the current implementation has a problem:
- symfony/symfony#51804

~This doc PR takes into account my fix PR above.~ Merged 👍

Commits
-------

061bc3f [TwigBridge] Add new Twig bridge function to generate impersonation path
  • Loading branch information
javiereguiluz committed Oct 4, 2023
2 parents 2d7d9ce + 061bc3f commit 3d3bf88
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions reference/twig_reference.rst
Expand Up @@ -286,6 +286,41 @@ expression
Creates an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` related
to the :doc:`ExpressionLanguage component </components/expression_language>`.

impersonation_path
~~~~~~~~~~~~~~~~~~

.. code-block:: twig
{{ impersonation_path(identifier) }}
``identifier``
**type**: ``string``

Generates a URL that you can visit to
:doc:`impersonate a user </security/impersonating_user>`, identified by the
``identifier`` argument.

.. versionadded:: 6.4

The ``impersonation_path()`` function was introduced in Symfony 6.4.

impersonation_url

Check failure on line 307 in reference/twig_reference.rst

View workflow job for this annotation

GitHub Actions / Lint (DOCtor-RST)

Please ensure title "impersonation_url
~~~~~~~~~~~~~~~~~~

.. code-block:: twig
{{ impersonation_url(identifier) }}
``identifier``
**type**: ``string``

It's similar to the `impersonation_path`_ function, but it generates
absolute URLs instead of relative URLs.

.. versionadded:: 6.4

The ``impersonation_url()`` function was introduced in Symfony 6.4.

impersonation_exit_path
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 3d3bf88

Please sign in to comment.