[Catalyst] Relative links

Andreas Marienborg omega at palle.net
Wed Nov 9 23:18:21 CET 2005


On 9. nov. 2005, at 22.59, Bill Moseley wrote:

> On Wed, Nov 09, 2005 at 09:22:26PM +0000, Matt S Trout wrote:
>> On Wed, Nov 09, 2005 at 01:02:08PM -0800, Bill Moseley wrote:
>>> I originally was creating a $c->stash->{myself} entry for
>>> self-referencing links in all my controllers.  Seems like the  
>>> only way
>>> since Catalyst can't really know what action is the "self".
>>
>> As of 5.49, you can access the Catalyst::Action object for the  
>> current action
>> via $c->action. Something like $c->action->attributes->{Path}[0]  
>> will work
>> for any Path or Regex action.
>
> That's all based on the action that matched.  My situation is when
> forwarding to another action.  I guess I'd need it to seem like the
> forwarded action is the action that matched.

What I do for things like delete and stuff like that, is I redirect  
afterwards, back to the list.

That way the url stays nice and clean, and chance of problems like  
this is less I think.


andreas



More information about the Catalyst mailing list