On 26 Jan 2007, at 20:41, Jason Gottshall wrote:

In using chained dispatch, I found that getting URIs for specific
endpoints felt a bit clumsy:

I wanted a way to condense the fairly wordy call to
$c->controller()->action_for(), so I added the following convenience
method to MyApp.pm:

  sub uri_for_endpoint {
    my ( $c, $endpoint, @args ) = @_;
    my ( $controller, $action ) = ( split m[/], $endpoint, 2 )[ -2, -1
];
    return $c->uri_for(
      $c->controller($controller)->action_for($action),
        @args
    );
  }

I think the last long discussion on the -dev list about this (archives are public and googlable :) resulted in us calling it uri_to and not trying to make it Chained-specific, and wanting to make it more intelligent than yours.

Maybe you could subscribe to -dev and once we finally thrash out what we want to do with this you could help with implementation/test-cases/ whatever?

But yeah, it -is- a sensible idea and we already want something in the dist and we'd love you to help out with getting it in there :D

--
Matt S Trout, Technical Director, Shadowcat Systems Ltd.
Offering custom development, consultancy and support contracts for Catalyst, DBIx::Class and BAST. Contact mst (at) shadowcatsystems.co.uk for details. + Help us build a better perl ORM: http://dbix- class.shadowcatsystems.co.uk/ +



_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to