Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Leave impersonation functions#14185

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
javiereguiluz merged 1 commit intosymfony:masterfromdFayet:impersonating_exit
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes fromall 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
27 changes: 27 additions & 0 deletionsreference/twig_reference.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -267,6 +267,33 @@ expression
Creates an :class:`Symfony\\Component\\ExpressionLanguage\\Expression` related
to the :doc:`ExpressionLanguage component </components/expression_language>`.

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

.. code-block:: twig

{{ impersonation_exit_path(exitTo = null) }}

``exitTo`` *(optional)*
**type**: ``string``

Generates a relative URL to exit impersonation. If `exitTo` is specified it will use its value to build the URl,
elsewhere it will use the current URI.
If we are not impersonating a user, it will return an empty string.

impersonation_exit_url
~~~~~~~~~~~~~~~~~~~~~~

.. code-block:: twig

{{ impersonation_exit_url(exitTo = null) }}

``exitTo`` *(optional)*
**type**: ``string``

Equal to the `impersonation_exit_path`_ function, but it'll generate an absolute URL
instead of a relative one.

Form Related Functions
~~~~~~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 1 addition & 1 deletionsecurity/impersonating_user.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -94,7 +94,7 @@ instance, to show a link to exit impersonation in a template:
.. code-block:: html+twig

{% if is_granted('IS_IMPERSONATOR') %}
<a href="{{ path('homepage', {'_switch_user': '_exit'}) }}">Exit impersonation</a>
<a href="{{impersonation_exit_path(path('homepage')) }}">Exit impersonation</a>
{% endif %}

.. versionadded:: 5.1
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp