[Catalyst-dev] RFC: action_uri

A. Pagaltzis pagaltzis at gmx.de
Mon Oct 2 14:23:30 CEST 2006


* Bogdan Lucaciu <bogdan at wiz.ro> [2006-10-02 13:35]:
> Would this alternative syntax be acceptable:
> $c->action_uri('Foo::Bar->baz', bla); ?

Hiding special syntax inside a string is a bad idea. Just pass
two parameters.

    $c->action_uri_for( 'Foo::Bar' => baz => bla );

It is also conceivable to shift the problem around:

    $c->controller('Foo::Bar')->action_for('baz')->uri_for($c, bla);

As long as the original, but a bit more convenient, and might be
useful in its own right in some contexts.

But I don’t like any of these options. They mix too many
different responsibilities. Hmm… I think a method on `$c` much
like `controller` would be the cleanest approach:

    $c->uri_for($c->action_for('Foo::Bar', 'baz'), bla);

Hmm, come to think of it, both `action_uri_for` and `action_for`
should probably be added.


Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst-dev mailing list