Skip to content

Commit 443d61e

Browse files
committed
minor #6218 path() explanation inside templating + Minor formatting changes (sfdumi)
This PR was submitted for the 3.0 branch but it was merged into the 2.7 branch instead (closes #6218). Discussion ---------- path() explanation inside templating + Minor formatting changes Mention that "path()" generates relative URLs. Take out an "=" sign out of code syntax. Single quotes instead of double ones in javascript example. Format "AppBundle" inside the example table for controller short names. Commits ------- c868c5a path() explanation inside templating + Minor formatting changes
2 parents f24f585 + c868c5a commit 443d61e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

book/routing.rst

+9-7
Original file line numberDiff line numberDiff line change
@@ -1169,11 +1169,11 @@ each separated by a colon:
11691169

11701170
For example, a ``_controller`` value of ``AppBundle:Blog:show`` means:
11711171

1172-
========= ================== ==============
1173-
Bundle Controller Class Method Name
1174-
========= ================== ==============
1175-
AppBundle ``BlogController`` ``showAction``
1176-
========= ================== ==============
1172+
============= ================== ==============
1173+
Bundle Controller Class Method Name
1174+
============= ================== ==============
1175+
``AppBundle`` ``BlogController`` ``showAction``
1176+
============= ================== ==============
11771177

11781178
The controller might look like this::
11791179

@@ -1471,7 +1471,7 @@ system. Take the ``blog_show`` example route from earlier::
14711471
// /blog/my-blog-post
14721472

14731473
To generate a URL, you need to specify the name of the route (e.g. ``blog_show``)
1474-
and any wildcards (e.g. ``slug = my-blog-post``) used in the path for that
1474+
and any wildcards (e.g. ``slug`` = ``my-blog-post``) used in the path for that
14751475
route. With this information, any URL can easily be generated::
14761476

14771477
class MainController extends Controller
@@ -1510,7 +1510,7 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.
15101510
15111511
var url = Routing.generate(
15121512
'blog_show',
1513-
{"slug": 'my-blog-post'}
1513+
{'slug': 'my-blog-post'}
15141514
);
15151515
15161516
For more information, see the documentation for that bundle.
@@ -1577,6 +1577,8 @@ a template helper function:
15771577
) ?>";
15781578
</script>
15791579

1580+
The ``path()`` method generates relative URLs.
1581+
15801582
.. index::
15811583
single: Routing; Absolute URLs
15821584

0 commit comments

Comments
 (0)