[Catalyst] Literal controller
Maxim Nechaev
nechaev at technodesign.ru
Wed Nov 30 06:52:24 CET 2005
Hello.
I have a question about literal url handlers. I have controller:
################################################
package Food::Controller::PseudoStatic;
use base 'Catalyst::Controller';
use strict;
use warnings;
sub start : Path('/')
{
my ($self, $context) = @_;
$context->stash->{template} = 'start.tmpl';
}
sub about : Path('/about')
{
my ($self, $context) = @_;
$context->stash->{template} = 'about.tmpl';
}
1;
################################################
Handler "about" work perfect, but handler "start" not worked. Debug
log contain:
###############################################
[Wed Nov 30 15:23:11 2005] [catalyst] [info] Food powered by Catalyst 5.57
[Wed Nov 30 15:43:15 2005] [catalyst] [debug] Debug messages enabled
[Wed Nov 30 15:43:16 2005] [catalyst] [debug] Loaded plugins:
.------------------------------------------------------------------------------.
| Catalyst::Plugin::Static::Simple |
'------------------------------------------------------------------------------'
[Wed Nov 30 15:43:16 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher"
[Wed Nov 30 15:43:16 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::CGI"
[Wed Nov 30 15:43:16 2005] [catalyst] [debug] Found home "/home/nechaev/Food"
[Wed Nov 30 15:43:17 2005] [catalyst] [debug] Loaded components:
.-------------------------------------------------------------------+----------.
| Class | Type |
+-------------------------------------------------------------------+----------+
| Food::Controller::PseudoStatic | instance |
| Food::View::HTML::Template | instance |
'-------------------------------------------------------------------+----------'
[Wed Nov 30 15:43:17 2005] [catalyst] [debug] Loaded Private actions:
.----------------------+----------------------------------------+--------------.
| Private | Class | Method |
+----------------------+----------------------------------------+--------------+
| /end | Food | end |
| /pseudostatic/about | Food::Controller::PseudoStatic | about |
| /pseudostatic/start | Food::Controller::PseudoStatic | start |
'----------------------+----------------------------------------+--------------'
[Wed Nov 30 15:43:17 2005] [catalyst] [debug] Loaded Path actions:
.--------------------------------------+---------------------------------------.
| Path | Private |
+--------------------------------------+---------------------------------------+
| / | /pseudostatic/start |
| /about | /pseudostatic/about |
'--------------------------------------+---------------------------------------'
[Wed Nov 30 15:43:17 2005] [catalyst] [info] Food powered by Catalyst 5.57
[Wed Nov 30 15:43:17 2005] [catalyst] [debug] **********************************
[Wed Nov 30 15:43:17 2005] [catalyst] [debug] * Request 1 (0.500/s) [678]
[Wed Nov 30 15:43:17 2005] [catalyst] [debug] **********************************
[Wed Nov 30 15:43:18 2005] [catalyst] [debug] "GET" request for "" from "192.168.15.46"
[Wed Nov 30 15:43:18 2005] [catalyst] [debug] No template specified for rendering
[Wed Nov 30 15:43:18 2005] [catalyst] [info] Request took 0.325516s (3.072/s)
.------------------------------------------------------------------+-----------.
| Action | Time |
+------------------------------------------------------------------+-----------+
| -> Food::View::HTML::Template->process | 0.000293s |
| /end | 0.002471s |
'------------------------------------------------------------------+-----------'
#####################################
Looks like handler "start" not called.
I'am doing something wrong?
What i need to expect when wrote: "sub start : Path('/')"?
How to handle root path in my controller?
--
Maxim Nechaev
More information about the Catalyst
mailing list