@@ -1192,29 +1192,6 @@ In an upcoming section, you'll learn how to generate URLs from inside templates.
11921192
11931193 For more information, see the documentation for that bundle.
11941194
1195- ..index ::
1196- single: Routing; Absolute URLs
1197-
1198- Generating Absolute URLs
1199- ~~~~~~~~~~~~~~~~~~~~~~~~
1200-
1201- By default, the router will generate relative URLs (e.g. ``/blog ``). To generate
1202- an absolute URL, simply pass ``true `` to the third argument of the ``generate() ``
1203- method::
1204-
1205- $this->get('router')->generate('blog_show', array('slug' => 'my-blog-post'), true);
1206- // http://www.example.com/blog/my-blog-post
1207-
1208- ..note ::
1209-
1210- The host that's used when generating an absolute URL is the host of
1211- the current ``Request `` object. This is detected automatically based
1212- on server information supplied by PHP. When generating absolute URLs for
1213- scripts run from the command line, you'll need to manually set the desired
1214- host on the ``RequestContext `` object::
1215-
1216- $this->get('router')->getContext()->setHost('www.example.com');
1217-
12181195..index ::
12191196 single: Routing; Generating URLs in a template
12201197
@@ -1227,7 +1204,7 @@ But if you pass extra ones, they will be added to the URI as a query string::
12271204 $this->get('router')->generate('blog', array('page' => 2, 'category' => 'Symfony'));
12281205 // /blog/2?category=Symfony
12291206
1230- Generating URLs from atemplate
1207+ Generating URLs from aTemplate
12311208~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12321209
12331210The most common place to generate a URL is from within a template when linking
@@ -1250,7 +1227,20 @@ a template helper function:
12501227 Read this blog post.
12511228 </a>
12521229
1253- Absolute URLs can also be generated.
1230+ ..index ::
1231+ single: Routing; Absolute URLs
1232+
1233+ Generating Absolute URLs
1234+ ~~~~~~~~~~~~~~~~~~~~~~~~
1235+
1236+ By default, the router will generate relative URLs (e.g. ``/blog ``). From
1237+ a controller, simply pass ``true `` to the third argument of the ``generateUrl() ``
1238+ method::
1239+
1240+ $this->getgenerateUrl('blog_show', array('slug' => 'my-blog-post'), true);
1241+ // http://www.example.com/blog/my-blog-post
1242+
1243+ From a template, it looks like this:
12541244
12551245..configuration-block ::
12561246
@@ -1268,6 +1258,14 @@ Absolute URLs can also be generated.
12681258 Read this blog post.
12691259 </a>
12701260
1261+ ..note ::
1262+
1263+ The host that's used when generating an absolute URL is the host of
1264+ the current ``Request `` object. This is detected automatically. But if
1265+ you generate absolute URLs for scripts run from the command line, this
1266+ won't work. But don't worry! Just see:doc: `/cookbook/console/sending_emails `
1267+ for details.
1268+
12711269Summary
12721270-------
12731271