8000 [#2079] Tweaking language, adding "ok" example · symfony/symfony-docs@df85a35 · GitHub
[go: up one dir, main page]

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

Appearance settings

Commit df85a35

Browse files
committed
[#2079] Tweaking language, adding "ok" example
1 parent cd0e142 commit df85a35

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cookbook/controller/error_pages.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,11 @@ end-user, create a new template located at
5252

5353
.. caution::
5454

55-
You **must not** use ``is_granted`` in your error pages, because the
56-
router runs before the firewall. If the router throws an exception (for
57-
instance, when the route does not match), the error page is not behind a
58-
firewall and ``app.user`` is not defined.
55+
You **must not** use ``is_granted`` in your error pages (or layout used
56+
by your error pages), because the router runs before the firewall. If
57+
the router throws an exception (for instance, when the route does not
58+
match), then using ``is_granted`` will throw a further exception. You
59+
can use ``is_granted`` safely by saying ``{% if app.security and is_granted('...') %}``.
5960

6061
.. tip::
6162

0 commit comments

Comments
 (0)
0