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 940fb8f

Browse filesBrowse files
committed
clarify the routing component documentation a bit
1 parent 523d08c commit 940fb8f
Copy full SHA for 940fb8f

File tree

Expand file treeCollapse file tree

1 file changed

+11
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-4
lines changed

‎components/routing/introduction.rst

Copy file name to clipboardExpand all lines: components/routing/introduction.rst
+11-4Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ URL path and some array of custom variables in its constructor. This array
6262
of custom variables can be *anything* that's significant to your application,
6363
and is returned when that route is matched.
6464

65-
If no matching route can be found a
66-
:class:`Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException` will be thrown.
65+
The :method:`UrlMatcher::match() <Symfony\\Component\\Routing\\UrlMatcher::match>`
66+
returns the variables you set on the route as well as the wildcard placeholders
67+
(see below). Your application can now use this information to continue
68+
processing the request. In addition to the configured variables, a ``_route``
69+
key is added, which holds the name of the matched route.
6770

68-
In addition to your array of custom variables, a ``_route`` key is added,
69-
which holds the name of the matched route.
71+
If no matching route can be found, a
72+
:class:`Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException` will
73+
be thrown.
7074

7175
Defining Routes
7276
~~~~~~~~~~~~~~~
@@ -126,6 +130,9 @@ In this case, the route is matched by ``/archive/2012-01``, because the ``{month
126130
wildcard matches the regular expression wildcard given. However, ``/archive/foo``
127131
does *not* match, because "foo" fails the month wildcard.
128132

133+
When using wildcards, these are returned in the resulting array of calling
134+
``match``. The part of the path that the wildcard matched is used as value.
135+
129136
.. tip::
130137

131138
If you want to match all URLs which start with a certain path and end in an

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.