From c868c5a686b022a20b1c76806089bf7b936c4f83 Mon Sep 17 00:00:00 2001 From: Sorin Dumitrescu Date: Tue, 2 Feb 2016 17:39:07 +0200 Subject: [PATCH] path() explanation inside templating + Minor formatting changes --- book/routing.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/book/routing.rst b/book/routing.rst index 139c3ceba51..a58920cbde7 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1169,11 +1169,11 @@ each separated by a colon: For example, a ``_controller`` value of ``AppBundle:Blog:show`` means: -========= ================== ============== -Bundle Controller Class Method Name -========= ================== ============== -AppBundle ``BlogController`` ``showAction`` -========= ================== ============== +============= ================== ============== +Bundle Controller Class Method Name +============= ================== ============== +``AppBundle`` ``BlogController`` ``showAction`` +============= ================== ============== The controller might look like this:: @@ -1471,7 +1471,7 @@ system. Take the ``blog_show`` example route from earlier:: // /blog/my-blog-post To generate a URL, you need to specify the name of the route (e.g. ``blog_show``) -and any wildcards (e.g. ``slug = my-blog-post``) used in the path for that +and any wildcards (e.g. ``slug`` = ``my-blog-post``) used in the path for that route. With this information, any URL can easily be generated:: class MainController extends Controller @@ -1510,7 +1510,7 @@ In an upcoming section, you'll learn how to generate URLs from inside templates. var url = Routing.generate( 'blog_show', - {"slug": 'my-blog-post'} + {'slug': 'my-blog-post'} ); For more information, see the documentation for that bundle. @@ -1577,6 +1577,8 @@ a template helper function: ) ?>"; +The ``path()`` method generates relative URLs. + .. index:: single: Routing; Absolute URLs