I've been working on a Catalyst application, and have come
across a few places that appear difficult to generate a URI
for using uri_for().  I'm thinking of creating a plugin that
can provide the functionality I'm looking for.

In particular, when I am in a controller whose actions are
chained, I would like to be able to be able to generate URIs
- actions in the parent controller (earlier in the chain)
- actions in the controller we are in
- actions in a child controller (later in the chain)
- actions in a non-related controller

I've been able to generate the URIs I want using uri_for(),
except for actions in a parent controller (earlier in the
chain).  The syntax to create some of the other URIs is a bit
complicated, and I find I have to look it up every time.  The
plugin Catalyst::Plugin::URI provides a simplified syntax.

My idea is to create a plugin with an interface something
like this:

    # URI for 'list' action on the current controller
    $c->internal_uri(action => 'list');

    # URI for 'view' action on the parent controller (up the chain)
    $c->internal_uri(controller => '..', action => 'view');

    # URI for 'list' action on a child or unrelated controller
    $c->internal_uri(controller => $name, action => 'list', captures =>

Any advice or perspectives that would help me create such a
plugin, or make it more useful?


List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to