I have realised I can get the parent route by using $request- 
 >getAttribute('matched_routes', 'org.agavi.routing'), and then  
finding the last-but-one matched route. This is done in either action/ 
view.

However, I would think it's better for this to be in the request data  
holder... is this possible? Or am I again barking up the wrong tree...?

Michal.


On 7 Mar 2009, at 18:38, Michal Charemza wrote:

> Hi,
>
> I have a number of routes calling actions, for example:
>
> <route pattern="^/events/$" module="Events" action="ShowEvents"  
> name="Events" />
>
> Some (but not all) of the views of the actions called by the routes,  
> also set a slot on a page, calling an action that shows related  
> links, ShowRelated. This related links are stored in a database by  
> route *name*. I thought this good in case the actual pattern changes  
> in future. The route name is defined as a string literal in each  
> view and passed by createSlotContainer to the ShowRelated action.
>
> Now, what I would like is for urls like
>
> /events/editrelatedlinks/
>
> to call the action 'EditRelated' (in order to show/process forms for  
> editors to edit the links for the page). To achieve this I could  
> have something like:
>
> <route pattern="^/events/" module="Events" action="ShowEvents"  
> name="Events" >
>  <route pattern="ediitrelatedlinks/$"   module="Related"  
> action="EditRelated" name="EditRelatedEvents" />
> </route>
>
> However, the 'EditRelated' action won't know the name of its  
> 'parent' route, in this case 'Events', in order to properly access  
> the database of links. Is there a way for it to find out what it  
> was? Or is there a way to define a parameter in the route  
> definition, that will end up in the request data holder in the  
> called action? Or maybe should I be storing my related links in the  
> database in a different way?
>
> Michal.


_______________________________________________
users mailing list
[email protected]
http://lists.agavi.org/mailman/listinfo/users

Reply via email to