Hi Tom,

I believe you can get access to the routing from the layout by using
the $sf_context variable. $sf_context->getRouting() should return a
sfRouting object (http://www.symfony-project.org/api/1_2/sfRouting).
You can then use the getRoutes() method of this object in order to get
access to a collection of sfRoute objects (http://www.symfony-
project.org/api/1_2/sfRoute). I haven't tested this, but in theory it
should give you access to what you want :)

However, I'm not too sure if this is a good practice. Depending on
what you want to achieve, it would be best to simply set different
routing rules. For example, for the photos section you would have a
routing rule like this:

photos:
  url: /:id/photos.htm
  param: { module: property, action: photos }


then on the actions for this module you can use the ID passed by the
user to do whatever:

  public function executePhotos(sfWebRequest $request)
  {
        $this->image = $request->getParameter('id') .'.png';
  }


and then obviously you could use this variable on the view:

<img src=". $image ." />


Hope to have helped!

Best Regards,

Thiago Campezzi





On Apr 9, 12:09 am, Tom Haskins-Vaughan <t...@templestreetmedia.com>
wrote:
> Hi,
>
> I have a website where the people are given a url from some off-line
> source. e.g.
>
> example.com/22
>
> I'm using the doctrine routing object for my routes.
>
> 22 is the id of a property and needs to be included in the routing in
> order to see other parts of the property:
>
> example.com/22/photos.htm
> example.com/22/town-info.htm
> example.com/22/view-property.htm
>
> So in layout.php I'd like to have access to the route object, but I
> don't see a way of accessing the route object in the layout. Is there a way?
>
> Thanks in advance.
>
> Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to