[Catalyst] New Root Controller in Catalyst 5.66

Sébastien Wagener sebastien.wagener at gmail.com
Mon Apr 17 11:09:25 CEST 2006


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 );
}

If I put it into the Root controller, it is not called at all. Here's
the catalyst output for this case (end action moved into the Root
controller):
[Mon Apr 17 10:57:12 2006] [catalyst] [debug] **************************
[Mon Apr 17 10:57:12 2006] [catalyst] [debug] * Request 1 (0.083/s)
[11071]
[Mon Apr 17 10:57:12 2006] [catalyst] [debug] **************************
[Mon Apr 17 10:57:12 2006] [catalyst] [debug] "GET" request for "" from
"127.0.0.1"
[Mon Apr 17 10:57:12 2006] [catalyst] [debug] Rendering template
"welcome.tt"
[Mon Apr 17 10:57:12 2006] [catalyst] [info] Request took 0.093881s
(10.652/s)
.------------------------------------------------------------------+-----------.
| Action                                                           |
Time      |
+------------------------------------------------------------------+-----------+
| /default                                                         |
0.000096s |
| /end                                                             |
0.066571s |
|  -> ct::View::TT->process                                        |
0.064355s |
'------------------------------------------------------------------+-----------'

If this is the normal behaviour, it could be misleading for beginners
who see the end action stub in their generated Root controller code. At
least I was quite confused.

Thanks for your comments.

Sébastien




More information about the Catalyst mailing list