[Catalyst] New Root Controller in Catalyst 5.66

T. H. Lin easy.lin at gmail.com
Mon May 1 16:29:00 CEST 2006


after reading
http://www.catalystframework.org/calendar/2005/8

I did
# in MyAPP.pm
use Catalyst qw/-Debug
                ConfigLoader
                Static::Simple
                DefaultEnd
                ..../;

# in MyApp/Controller/Root.pm
sub end : Private {
    my ( $self, $c ) = @_;

    #code before view

    $c->NEXT::end( $c );

    #code after view
}

but
.------------------------------------------------------------------+-----------.
| Action                                                           | Time      |
+------------------------------------------------------------------+-----------+
| /some_action                                            | 0.000158s |
| /end                                                             | 0.000481s |
'------------------------------------------------------------------+-----------'
it looks that DefaultEnd isn't triggered.


On 17/04/06, Sebastian Riedel <sri at oook.de> wrote:
>
> 17.04.2006 15:30 Matt S Trout:
>
> > Sébastien Wagener wrote:
> >> On Wed, 2006-03-01 at 13:27 +0000, Matt S Trout wrote:
> >>> On Wed, Mar 01, 2006 at 06:00:01AM +0100, Sebastian Riedel wrote:
> >>>> 01.03.2006 05:39 Nilson Santos Figueiredo Junior:
> >>>>
> >>>>> On 3/1/06, Sebastian Riedel <sri at oook.de> wrote:
> >>>>>> This is another best practice promoted to be part of core, it
> >>>>>> will
> >>>>>> eliminate namespace collisions like for the famous "login"
> >>>>>> action in
> >>>>>> combination with auth plugins. ;)
> >>>> The application class was from the beginning just meant as a
> >>>> place to
> >>>> interact with Catalyst "internals", load plugins, configure the app
> >>>> and the like.
> >>> And of course, your $c for each request is blessed into that
> >>> class by
> >>> default (unless you set __PACkAGE__->context_class to something
> >>> else).
> >>>
> >> Is it normal that I still have to put the end action into the app
> >> class
> >> (instead of the Root controller) while using DefaultEnd?
> >>
> >> My end action:
> >> sub end : Private {
> >>   my ($self, $c) = @_;
> >>   $c->log->debug("app end action");
> >>   $c->NEXT::end( $c );
> >> }
> >
> > Catalyst::Plugin::DefaultEnd should probably really be
> > Catalyst::Controller::DefaultEnd; I usually have my Controller::Root
> >
> > use base qw/Catalyst::Controller Catalyst::Plugin::DefaultEnd/;
>
> It should be a action class.
>
>      sub end : Private : Action('DefaultEnd') {}
>
> --
> sebastian
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>



More information about the Catalyst mailing list