[Catalyst] why is c.req.action missing leading slash?

Phil Mitchell seasprocket at gmail.com
Sat Aug 13 22:52:15 CEST 2005


On 8/13/05, Sebastian Riedel <sri at oook.de> wrote:
> 
> Am 13.08.2005 um 20:03 schrieb Phil Mitchell:
> 
> > Bug or feature? Or am I just completely confused?
> >
> > For an action such as '/page/edit', c.req.action holds 'page/edit' --
> > I'm guessing that was done for a good reason, but it complicates my
> > usage. Right now I'm abstracting all action names out of my view
> > templates, so I have to worry about whether they have leading slash or
> > not.
> 
> Don't use action, it won't work for regex, use c.req.match instead.
> It has no leading slash cause c.req.base is guaranteed to have a
> slash as last char.

That makes sense, of course, but the failure of:

$c->forward($c->req->action)

is pretty surprising...


-- 
==========================
2People Blog: http://2-people.blogspot.com/
2People site: http://www.2people.org



More information about the Catalyst mailing list