[Catalyst] controller subclass and :Local actions

Marcello Romani mromani at ottotecnica.com
Mon Jan 19 08:12:43 GMT 2009


Rodrigo ha scritto:
> 
> 
> On Fri, Jan 16, 2009 at 6:13 PM, Marcello Romani 
> <mromani at ottotecnica.com <mailto:mromani at ottotecnica.com>> wrote:
> 
>     Hallo,
>        I have a controller base class that implements the usual crud
>     actions (list, create, etc.), and I would like to override i.e. the
>     list method in a subclass, but the subclass' list method doesn't
>     seem to get called...
> 
>     In MyApp::Controller::Base:
> 
>     use base qw( Catalyst::Controller );
> 
>     sub list : Local {
>        do stuff
>     }
> 
>     In MyApp::Controller::CD:
> 
>     use base qw( MyApp::Controller::Base );
> 
>     sub list : Local {
>        do other stuff
>     }
> 
> 
>     when I call /myapp/cd/list the base controller's list action gets
>     called...
> 
>     Can someone give me a hint ?
> 
>     Thank you.
> 
>     -- 
>     Marcello Romani
> 
> 
> Strange. That works fine for me. What does the debug output prints out 
> for the path dispatch table when the server starts up?
> 
> It should look something like this:
> 
> [debug] Loaded Path actions:
> .---------------------+--------------------.
> | Path                | Private            |
> +---------------------+--------------------+
> | /base/list          | /base/list         |
> | /cd/list            | /cd/list           |
> '---------------------+--------------------'
> 
> -rodrigo
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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/

It works fine for me too, today :-)

I always use the dev server with -r, so it could be that the thing was 
not picked up until I CTRL-C'ed the server and restarted manually...

Sorry for the noise.

-- 
Marcello Romani




More information about the Catalyst mailing list