Skip to content

Commit d35b34f

Browse files
committed
Merge pull request symfony#2165 from WouterJ/update_routing_22
[2.2] Updated most routing changes
2 parents 240a1e2 + 4e5cca2 commit d35b34f

14 files changed

+176
-199
lines changed

book/controller.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Mapping a URL to a Controller
141141
-----------------------------
142142

143143
The new controller returns a simple HTML page. To actually view this page
144-
in your browser, you need to create a route, which maps a specific URL pattern
144+
in your browser, you need to create a route, which maps a specific URL path
145145
to the controller:
146146

147147
.. configuration-block::
@@ -150,13 +150,13 @@ to the controller:
150150
151151
# app/config/routing.yml
152152
hello:
153-
pattern: /hello/{name}
154-
defaults: { _controller: AcmeHelloBundle:Hello:index }
153+
path: /hello/{name}
154+
defaults: { _controller: AcmeHelloBundle:Hello:index }
155155
156156
.. code-block:: xml
157157
158158
<!-- app/config/routing.xml -->
159-
<route id="hello" pattern="/hello/{name}">
159+
<route id="hello" path="/hello/{name}">
160160
<default key="_controller">AcmeHelloBundle:Hello:index</default>
161161
</route>
162162
@@ -229,13 +229,13 @@ example:
229229
230230
# app/config/routing.yml
231231
hello:
232-
pattern: /hello/{first_name}/{last_name}
233-
defaults: { _controller: AcmeHelloBundle:Hello:index, color: green }
232+
path: /hello/{first_name}/{last_name}
233+
defaults: { _controller: AcmeHelloBundle:Hello:index, color: green }
234234
235235
.. code-block:: xml
236236
237237
<!-- app/config/routing.xml -->
238-
<route id="hello" pattern="/hello/{first_name}/{last_name}">
238+
<route id="hello" path="/hello/{first_name}/{last_name}">
239239
<default key="_controller">AcmeHelloBundle:Hello:index</default>
240240
<default key="color">green</default>
241241
</route>

book/from_flat_php_to_symfony2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,11 +639,11 @@ A routing configuration map provides this information in a readable format:
639639
640640
# app/config/routing.yml
641641
blog_list:
642-
pattern: /blog
642+
path: /blog
643643
defaults: { _controller: AcmeBlogBundle:Blog:list }
644644
645645
blog_show:
646-
pattern: /blog/show/{id}
646+
path: /blog/show/{id}
647647
defaults: { _controller: AcmeBlogBundle:Blog:show }
648648
649649
Now that Symfony2 is handling all the mundane tasks, the front controller

book/http_fundamentals.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,12 @@ by adding an entry for ``/contact`` to your routing configuration file:
423423
424424
# app/config/routing.yml
425425
contact:
426-
pattern: /contact
426+
path: /contact
427427
defaults: { _controller: AcmeDemoBundle:Main:contact }
428428
429429
.. code-block:: xml
430430
431-
<route id="contact" pattern="/contact">
431+
<route id="contact" path="/contact">
432432
<default key="_controller">AcmeBlogBundle:Main:contact</default>
433433
</route>
434434

book/page_creation.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Creating a new page in Symfony2 is a simple two-step process:
88

99
* *Create a route*: A route defines the URL (e.g. ``/about``) to your page
1010
and specifies a controller (which is a PHP function) that Symfony2 should
11-
execute when the URL of an incoming request matches the route pattern;
11+
execute when the URL of an incoming request matches the route path;
1212

1313
* *Create a controller*: A controller is a PHP function that takes the incoming
1414
request and transforms it into the Symfony2 ``Response`` object that's
@@ -147,7 +147,7 @@ the new route that defines the URL of the page that you're about to create:
147147
148148
# src/Acme/HelloBundle/Resources/config/routing.yml
149149
hello:
150-
pattern: /hello/{name}
150+
path: /hello/{name}
151151
defaults: { _controller: AcmeHelloBundle:Hello:index }
152152
153153
.. code-block:: xml
@@ -159,7 +159,7 @@ the new route that defines the URL of the page that you're about to create:
159159
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
160160
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
161161
162-
<route id="hello" pattern="/hello/{name}">
162+
<route id="hello" path="/hello/{name}">
163163
<default key="_controller">AcmeHelloBundle:Hello:index</default>
164164
</route>
165165
</routes>
@@ -177,9 +177,9 @@ the new route that defines the URL of the page that you're about to create:
177177
178178
return $collection;
179179
180-
The routing consists of two basic pieces: the ``pattern``, which is the URL
180+
The routing consists of two basic pieces: the ``path``, which is the URL
181181
that this route will match, and a ``defaults`` array, which specifies the
182-
controller that should be executed. The placeholder syntax in the pattern
182+
controller that should be executed. The placeholder syntax in the path
183183
(``{name}``) is a wildcard. It means that ``/hello/Ryan``, ``/hello/Fabien``
184184
or any other similar URL will match this route. The ``{name}`` placeholder
185185
parameter will also be passed to the controller so that you can use its value

0 commit comments

Comments
 (0)