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

Commit826197b

Browse files
committed
[symfony#2785] Minor tweaks to new profiler matchers docs
1 parent1adc399 commit826197b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

‎cookbook/profiler/matchers.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
..index::
22
single: Profiling; Matchers
33

4-
How to use Matchers to enable the Profiler
5-
==========================================
4+
How to use Matchers to enable the Profiler Conditionally
5+
========================================================
66

77
By default, the profiler is only activated in the development environment. But
8-
it's imaginable that a developer always wants to see the profiler, even in
9-
production. Another situation may be to show the profiler when an admin has
10-
logged in. You can enable the profiler in these situations by using matchers.
8+
it's imaginable that a developer may want to see the profiler even in
9+
production. Another situation may be that you want to show the profiler only
10+
when an admin has logged in. You can enable the profiler in these situations
11+
by using matchers.
1112

12-
Using thebuild-in Matcher
13+
Using thebuilt-in Matcher
1314
--------------------------
1415

1516
Symfony2 provides a
16-
:class:`build-in matcher <Symfony\\Component\\HttpFoundation\\RequestMatcher>`
17-
which can match paths and IPs. Forinstance,only show the profiler when
18-
accessing the page with the ``168.0.0.1`` ip. Then, the profiler can be
19-
configured to something likethis:
17+
:class:`built-in matcher <Symfony\\Component\\HttpFoundation\\RequestMatcher>`
18+
which can match paths and IPs. Forexample, if you want toonly show the
19+
profiler whenaccessing the page with the ``168.0.0.1`` ip, then you can
20+
usethis configuration:
2021

2122
..configuration-block::
2223

@@ -48,7 +49,7 @@ configured to something like this:
4849
));
4950
5051
You can also set a ``path`` option to define the path on which the profiler
51-
should be enabled. For instance, setting it to `^/admin/` will enable the
52+
should be enabled. For instance, setting it to ``^/admin/`` will enable the
5253
profiler only for the ``/admin/`` urls.
5354

5455
Creating a Custom Matcher
@@ -60,8 +61,8 @@ which implements
6061
:class:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface`. This
6162
interface requires one method:
6263
:method:`Symfony\\Component\\HttpFoundation\\RequestMatcherInterface::matches`.
63-
This method returnsa falsey valueto disable the profiler, any other value
64-
enables theprofiler.
64+
This method returnsfalseto disable the profiler and true to enable the
65+
profiler.
6566

6667
To enable the profiler when a ``ROLE_SUPER_ADMIN`` is logged in, you can use
6768
something like::

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp