Development

#1403 (mistake in The Definitive Guide - 09-Links-and-the-Routing-System)

You must first sign up to be able to contribute.

Ticket #1403 (closed documentation: fixed)

Opened 2 years ago

Last modified 2 years ago

mistake in The Definitive Guide - 09-Links-and-the-Routing-System

Reported by: lucjan Assigned to:
Priority: minor Milestone: 1.0.0
Component: Version: 1.0.0-rc1
Keywords: Cc:
Qualification:

Description

At the bottom of the page:http://www.symfony-project.com/book/trunk/09-Links-and-the-Routing-System

If you need to transform an internal URI into an external URL in an action--just as url_for() 
does in a template--use the genUrl() method of the sfController object, as shown in Listing 9-26.

Listing 9-26 - Using sfController to Transform an Internal URI

$uri = 'article/read?id=21';

$url = $this->getController()->genUrl($uri);
=> /article/21

$url = $this->getController()->genUrl($uri);
=> http://myapp.example.com/article/21

Probably the second link should look like this: $url = $this->getController()->genUrl($uri,true);

(from http://www.symfony-project.com/forum/index.php/t/4838/ )

Change History

02/06/07 08:16:50 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [3405]) book: fixed typo (closes #1403)