[Catalyst-dev] RFC: action_uri
John Napiorkowski
jjn1056 at yahoo.com
Tue Oct 3 01:33:59 CEST 2006
--- Matt S Trout <dbix-class at trout.me.uk> wrote:
> John Napiorkowski wrote:
> > --- Bogdan Lucaciu <bogdan at wiz.ro> wrote:
> >
> >> Hello
> >>
> >>
> >
>
$c->uri_for($c->controller('Foo::Bar')->action_for('baz'),
> >> bla ) is used
> >> a lot, and it's the correct way of specifying an
> URI
> >> for a certain
> >> action.
> >>
> >> Would this alternative syntax be acceptable:
> >> $c->action_uri('Foo::Bar->baz', bla); ?
> >>
> >>
> >> I also thought of: $c->uri_for([qw/Foo::Bar,
> baz/],
> >> bla);
> >> but action_uri seems cleaner.
> >>
> >> Better naming suggestions are welcome :)
> >> I will prepare the patch according to your
> feedback.
> >>
> >
> > I'd try to make sure the default values work
> properly,
> > I do:
> >
> > $c->controller->action_for('action_name')
>
> If you're actually in the controller,
> $self->action_for('name') seems like
> even less typing.
>
Thanks for the tip, learn something every time I read
the mailing list :) -john
> --
> Matt S Trout Offering custom
> development, consultancy and support
> Technical Director contracts for Catalyst,
> DBIx::Class and BAST. Contact
> Shadowcat Systems Ltd. mst (at)
> shadowcatsystems.co.uk for more information
>
> + Help us build a better perl ORM:
> http://dbix-class.shadowcatsystems.co.uk/ +
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.rawmode.org
>
http://lists.rawmode.org/mailman/listinfo/catalyst-dev
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the Catalyst-dev
mailing list