[Catalyst-dev] RFC: action_uri
Matt S Trout
dbix-class at trout.me.uk
Mon Oct 2 21:05:04 CEST 2006
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.
--
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/ +
More information about the Catalyst-dev
mailing list