Skip to content

Commit 210bb4b

Browse files
committed
Some minor things
1 parent 4da1bcf commit 210bb4b

File tree

1 file changed

+21
-24
lines changed

1 file changed

+21
-24
lines changed

book/routing.rst

+21-24
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pattern that points to a specific PHP class and method::
9797
$article = ...;
9898

9999
return $this->render('Blog/show.html.twig', array(
100-
'blog' => $blog,
100+
'article' => $article,
101101
));
102102
}
103103
}
@@ -439,15 +439,13 @@ longer required. The URL ``/blog`` will match this route and the value of
439439
the ``page`` parameter will be set to ``1``. The URL ``/blog/2`` will also
440440
match, giving the ``page`` parameter a value of ``2``. Perfect.
441441

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+
=========== ===== ==========
451449

452450
.. caution::
453451

@@ -660,15 +658,14 @@ URL:
660658
For incoming requests, the ``{culture}`` portion of the URL is matched against
661659
the regular expression ``(en|fr)``.
662660

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+
======= ========================
672669

673670
.. index::
674671
single: Routing; Method requirement
@@ -884,11 +881,11 @@ each separated by a colon:
884881

885882
For example, a ``_controller`` value of ``AppBundle:Blog:show`` means:
886883

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+
========= ================== ==============
892889

893890
The controller might look like this::
894891

0 commit comments

Comments
 (0)