Skip to content

Commit

Permalink
minor #6218 path() explanation inside templating + Minor formatting c…
Browse files Browse the repository at this point in the history
…hanges (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
  • Loading branch information
wouterj committed Jul 8, 2016
2 parents f24f585 + c868c5a commit 443d61e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -1577,6 +1577,8 @@ a template helper function:
) ?>";
</script>

The ``path()`` method generates relative URLs.

.. index::
single: Routing; Absolute URLs

Expand Down

0 comments on commit 443d61e

Please sign in to comment.