Re: [Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-10 Thread Trevor Leffler
It turns out the length of the chaining is a variable in this equation. In my Test Controller... This gives "good" behavior: sub base : Chained('/') PathPart('test') CaptureArgs(0) {} sub another : Chained('base') PathPart('') CaptureArgs(0) {} sub index : Chained('another') PathPart('') Args(0)

Re: [Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-10 Thread Trevor Leffler
Hi Aristotle, On 02/10/2015 02:39 AM, Aristotle Pagaltzis wrote: Hi Trevor, * Trevor Leffler [2015-02-07 00:00]: Requests for non-extant paths fall through to Root->default(), which gives the (undesired) default root view. I tried giving my top-level controllers their own default() methods, b

Re: [Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-10 Thread Aristotle Pagaltzis
Hi Trevor, * Trevor Leffler [2015-02-07 00:00]: > Requests for non-extant paths fall through to Root->default(), which > gives the (undesired) default root view. I tried giving my top-level > controllers their own default() methods, but as others have found [1], > 'default() : Path' has precedenc

Re: [Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-09 Thread Trevor Leffler
On 2/9/2015 1:59 AM, Dmitry L. wrote: I'd rather split one application into several (admin app, survey app, etc) and "join" its via middleware. But you can try this: In MyApp::Admin: sub default : Path('admin') { # or # sub default : Chained(base) PathPart('') Path { my ( $self, $c ) = @_;

Re: [Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-09 Thread David Schmidt
On 9 February 2015 at 10:59, Dmitry L. wrote: > I'd rather split one application into several (admin app, survey app, > etc) and "join" its via middleware. I wrote a blog article a few months ago: http://blogs.perl.org/users/davewood/2014/08/splitting-a-catalyst-app-and-recombining-it-with-plackb

Re: [Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-09 Thread Dmitry L.
I'd rather split one application into several (admin app, survey app, etc) and "join" its via middleware. But you can try this: In MyApp::Admin: sub default : Path('admin') { # or # sub default : Chained(base) PathPart('') Path { my ( $self, $c ) = @_; $c->response->body( 'Page not found

[Catalyst] How to get default()-like behavior outside of the Root controller

2015-02-06 Thread Trevor Leffler
Some of my top-level controllers represent different, er... "major pieces" of my application. They have, among other things, different default views, which are mainly just for configuring different page wrappers. These controllers have this action pattern: package MyApp::Admin; sub base : Ch