Hi Bernhard,
Yes, i am using sfObjectRoutes.
You opened my eyes! Your trick is very nice.
I really didn't think of the solution passing the sfUser object "back" to
the routing.
I searched for the link between routing and sfContext|sfUser all the time,
without passing "additional" instances around.

Thanks,
Frank

>
> Hi Frank,
>
> Are you using sfObjectRoutes to fetch your custom data?
>
> If yes, let me explain the workflow of the sfObjectRoutes to you:
>
> 1. First, symfony checks, whether the requested URL matches the URL
> pattern
> 2. If yes, the filters, actions etc. are executed
> 3. Once sfObjectRoute::getObject() is called (usually from the
> actions), the matching object for the URL parameters is retrieved. If
> no object is found, an sfError404Exception is thrown.
>
> Thus, the trick is to write a custom getObject() route to which you
> can pass the current sfUser object from the action.
>
> // CustomObjectRoute.class.php
> public function getObjectForUser(sfUser $user)
> {
>   // retrieve the object or throw an sfError404Exception
> }
>
> // actions.class.php
> $object = $this->getRoute()->getObjectForUser($this->getUser());
>
>
> Bernhard
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
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