[Catalyst-dev] RT #36209: convert internal path seperators for clarity

Matt S Trout dbix-class at trout.me.uk
Sun Jun 8 18:29:14 BST 2008


On Wed, Jun 04, 2008 at 09:00:51PM +0200, Marcus Ramberg wrote:
> On 3. juni. 2008, at 08.31, Matt S Trout wrote:
> 
> >Yep. It uses the internal action  namespace, not the URI, so it's not
> >really a relative URI and can easily fail when you refactor your app  
> >later.
> >
> >Just don't use it.
> 
> I strongly disagree that we can say it is broken. Of course, if you  
> think it's related to the external uri  and not the controller you  
> will be surprised, but I don't think we can break backwards compat  
> lightly on this one. Saying 'doing that is broken' just won't do.

I'm not suggesting we can change the behaviour.

I'm just suggesting that the behaviour is so easily not DWIM that its usage
should be avoided, and the new action_uri stuff should do something more
sensible.

Basically, uri_for('foo') is on the same level as { foo => $req->param('foo') }
- it might do what you want at least some of the time, but it probably
doesn't mean what you think it means so in the general case it's safer not
to use it. uri_for($c->controller->action_for('foo')) and
{ foo => $c->req->params->{foo} } are both better.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst-dev mailing list