@@ -97,7 +97,7 @@ pattern that points to a specific PHP class and method::
97
97
$article = ...;
98
98
99
99
return $this->render('Blog/show.html.twig', array(
100
- 'blog ' => $blog ,
100
+ 'article ' => $article ,
101
101
));
102
102
}
103
103
}
@@ -439,15 +439,13 @@ longer required. The URL ``/blog`` will match this route and the value of
439
439
the ``page `` parameter will be set to ``1 ``. The URL ``/blog/2 `` will also
440
440
match, giving the ``page `` parameter a value of ``2 ``. Perfect.
441
441
442
- +--------------------+-------+-----------------------+
443
- | URL | route | parameters |
444
- +====================+=======+=======================+
445
- | /blog | blog | {page} = 1 |
446
- +--------------------+-------+-----------------------+
447
- | /blog/1 | blog | {page} = 1 |
448
- +--------------------+-------+-----------------------+
449
- | /blog/2 | blog | {page} = 2 |
450
- +--------------------+-------+-----------------------+
442
+ =========== ===== ==========
443
+ URL route parameters
444
+ =========== ===== ==========
445
+ ``/blog `` blog {page} = 1
446
+ ``/blog/1 `` blog {page} = 1
447
+ ``/blog/2 `` blog {page} = 2
448
+ =========== ===== ==========
451
449
452
450
.. caution ::
453
451
@@ -660,15 +658,14 @@ URL:
660
658
For incoming requests, the ``{culture} `` portion of the URL is matched against
661
659
the regular expression ``(en|fr) ``.
662
660
663
- +-----+--------------------------+
664
- | / | {culture} = en |
665
- +-----+--------------------------+
666
- | /en | {culture} = en |
667
- +-----+--------------------------+
668
- | /fr | {culture} = fr |
669
- +-----+--------------------------+
670
- | /es | *won't match this route * |
671
- +-----+--------------------------+
661
+ ======= ========================
662
+ path parameters
663
+ ======= ========================
664
+ ``/ `` {culture} = en
665
+ ``/en `` {culture} = en
666
+ ``/fr `` {culture} = fr
667
+ ``/es `` *won't match this route *
668
+ ======= ========================
672
669
673
670
.. index ::
674
671
single: Routing; Method requirement
@@ -884,11 +881,11 @@ each separated by a colon:
884
881
885
882
For example, a ``_controller `` value of ``AppBundle:Blog:show `` means:
886
883
887
- +----------------+------------------+-------------+
888
- | Bundle | Controller Class | Method Name |
889
- + ================+ ==================+ =============+
890
- | AppBundle | BlogController | showAction |
891
- +----------------+------------------+-------------+
884
+ ========= ================== ==============
885
+ Bundle Controller Class Method Name
886
+ ========= ================== ==============
887
+ AppBundle `` BlogController `` `` showAction ``
888
+ ========= ================== ==============
892
889
893
890
The controller might look like this::
894
891
0 commit comments