[Catalyst] plugin for generating URIs that is chaining-aware

Alexander.Hartmaier at t-systems.com Alexander.Hartmaier at t-systems.com
Tue Jul 6 06:45:56 GMT 2021

not sure what you mean by 'parent controller' as a chain endpoint action (the thing that maps to a URI) consists of chain elements that don't map to an URI, so uri_for for those makes no sense.

Best regards, Alex

PU Cyber Security
Network Architecture
Operation Manager Authentication
Rennweg 97-99, A-1030 Vienna
+43 57057 4320 (phone)
+43 676 8642 4320 (mobile)
E-mail: alexander.hartmaier at t-systems.com
Internet: www.t-systems.at
Blog: blog.t-systems.at
Social Media: Facebook, Linkedin, Twitter


T-Systems Austria GesmbH, Rennweg 97-99, A-1030 Vienna
Commercial Court Vienna, FN 79340b
Notice: This transmittal and/or attachments may be privileged or confidential. It is
intended solely for the addressee named above. If you received this transmittal in error,
please notify us immediately by reply and delete this message and all its attachments.
Thank you.
Von: catalyst-bounces at lists.scsys.co.uk <catalyst-bounces at lists.scsys.co.uk> im Auftrag von Nathan Gray <kolibrie at cpan.org>
Gesendet: Montag, 14. Juni 2021 21:23
An: catalyst at lists.scsys.co.uk <catalyst at lists.scsys.co.uk>
Betreff: [Catalyst] plugin for generating URIs that is chaining-aware

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 at 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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/catalyst/attachments/20210706/d830e471/attachment.html>

More information about the Catalyst mailing list