very cool. I need to go find the docs that talk about that bit of config magic, as I hadn't run into it yet.

- Stephen

On Jun 29, 2010, at 8:02 AM, Tomas Doran wrote:


On 29 Jun 2010, at 14:43, Stephen Howard wrote:

I may be off the mark on what you're trying to do, but here goes.

In my brief experience with catalyst, inheritance doesn't do much for you when constructing actions. I believe that chained actions are pretty tightly bound to the urls you are building, so there's no way to reuse them for different urls.

Entirely incorrect.

That said, something I often do is $c->forward my way to common private functions, rather than try to do it through inheritance. So, from that same project:

<snip gross solution which follows>

You can compose the actions you want to override from a role (or superclass, or whatever), and then use config to override the paths.

Here's an example (note the code here is simplistic / prototype, but it shows the concept):

http://github.com/bobtfish/Kaizendo/blob/master/lib/App/Kaizendo/Web/Controller/Project.pm

Cheers
t0m


_______________________________________________
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/


_______________________________________________
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