@@ -120,7 +120,7 @@ Thanks to these two routes:
120
120
121
121
* If the user goes to ``/blog/* ``, the second route is matched and ``showAction() ``
122
122
is executed. Because the route path is ``/blog/{slug} ``, a ``$slug `` variable is
123
- passed to ``showAction `` matching that value. For example, if the user goes to
123
+ passed to ``showAction() `` matching that value. For example, if the user goes to
124
124
``/blog/yay-routing ``, then ``$slug `` will equal ``yay-routing ``.
125
125
126
126
Whenever you have a ``{placeholder} `` in your route path, that portion becomes a
@@ -363,7 +363,7 @@ With all of this in mind, check out this advanced example:
363
363
{
364
364
/**
365
365
* @Route(
366
- * "/articles/{_locale}/{year}/{title }.{_format}",
366
+ * "/articles/{_locale}/{year}/{slug }.{_format}",
367
367
* defaults={"_format": "html"},
368
368
* requirements={
369
369
* "_locale": "en|fr",
@@ -372,7 +372,7 @@ With all of this in mind, check out this advanced example:
372
372
* }
373
373
* )
374
374
*/
375
- public function showAction($_locale, $year, $title )
375
+ public function showAction($_locale, $year, $slug )
376
376
{
377
377
}
378
378
}
@@ -381,7 +381,7 @@ With all of this in mind, check out this advanced example:
381
381
382
382
# app/config/routing.yml
383
383
article_show :
384
- path : /articles/{_locale}/{year}/{title }.{_format}
384
+ path : /articles/{_locale}/{year}/{slug }.{_format}
385
385
defaults : { _controller: AppBundle:Article:show, _format: html }
386
386
requirements :
387
387
_locale : en|fr
@@ -398,7 +398,7 @@ With all of this in mind, check out this advanced example:
398
398
http://symfony.com/schema/routing/routing-1.0.xsd" >
399
399
400
400
<route id =" article_show"
401
- path =" /articles/{_locale}/{year}/{title }.{_format}" >
401
+ path =" /articles/{_locale}/{year}/{slug }.{_format}" >
402
402
403
403
<default key =" _controller" >AppBundle:Article:show</default >
404
404
<default key =" _format" >html</default >
@@ -418,7 +418,7 @@ With all of this in mind, check out this advanced example:
418
418
$collection = new RouteCollection();
419
419
$collection->add(
420
420
'article_show',
421
- new Route('/articles/{_locale}/{year}/{title }.{_format}', array(
421
+ new Route('/articles/{_locale}/{year}/{slug }.{_format}', array(
422
422
'_controller' => 'AppBundle:Article:show',
423
423
'_format' => 'html',
424
424
), array(
@@ -502,11 +502,11 @@ The pattern has three parts, each separated by a colon:
502
502
503
503
For example, a ``_controller `` value of ``AppBundle:Blog:show `` means:
504
504
505
- ============= ================== ==============
505
+ ============= ================== ================
506
506
Bundle Controller Class Method Name
507
- ============= ================== ==============
508
- ``AppBundle `` ``BlogController `` ``showAction ``
509
- ============= ================== ==============
507
+ ============= ================== ================
508
+ ``AppBundle `` ``BlogController `` ``showAction() ``
509
+ ============= ================== ================
510
510
511
511
The controller might look like this::
512
512
@@ -524,7 +524,7 @@ The controller might look like this::
524
524
}
525
525
526
526
Notice that Symfony adds the string ``Controller `` to the class name (``Blog ``
527
- => ``BlogController ``) and ``Action `` to the method name (``show `` => ``showAction ``).
527
+ => ``BlogController ``) and ``Action `` to the method name (``show `` => ``showAction() ``).
528
528
529
529
You could also refer to this controller using its fully-qualified class name
530
530
and method: ``AppBundle\Controller\BlogController::showAction ``. But if you
0 commit comments