Skip to content

Small clarification to routing.rst #2854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ By default, the router will generate relative URLs (e.g. ``/blog``). To generate
an absolute URL, simply pass ``true`` to the third argument of the ``generate()``
method::

$router->generate('blog_show', array('slug' => 'my-blog-post'), true);
$this-get('router')->generate('blog_show', array('slug' => 'my-blog-post'), true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->get('router')

// http://www.example.com/blog/my-blog-post

.. note::
Expand All @@ -1212,7 +1212,7 @@ method::
scripts run from the command line, you'll need to manually set the desired
host on the ``RequestContext`` object::

$router->getContext()->setHost('www.example.com');
$this-get('router')->getContext()->setHost('www.example.com');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


.. index::
single: Routing; Generating URLs in a template
Expand All @@ -1223,7 +1223,7 @@ Generating URLs with Query Strings
The ``generate`` method takes an array of wildcard values to generate the URI.
But if you pass extra ones, they will be added to the URI as a query string::

$router->generate('blog', array('page' => 2, 'category' => 'Symfony'));
$this-get('router')->generate('blog', array('page' => 2, 'category' => 'Symfony'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

// /blog/2?category=Symfony

Generating URLs from a template
Expand Down