Forward processing to a private action or a method from a class.
If you define a class without method it will default to process().
- $c->forward('foo');
+ $c->forward('/foo');
$c->forward('index');
$c->forward(qw/MyApp::Model::CDBI::Foo do_stuff/);
$c->forward('MyApp::View::TT');
}
my $caller = caller(0);
my $namespace = '/';
- if ( $command =~ /^\/$/ ) {
+ if ( $command =~ /^\// ) {
$command =~ /^(.*)\/(\w+)$/;
$namespace = $1 || '/';
$command = $2;
}
$c->prepare_request($r);
$c->prepare_path;
- $c->prepare_cookies;
$c->prepare_headers;
+ $c->prepare_cookies;
$c->prepare_connection;
my $method = $c->req->method || '';
my $path = $c->req->path || '';
sub _class2prefix {
my $class = shift || '';
- $class =~ /^.*::([MVC]|Model|View|Controller)?::(.*)$/;
- my $prefix = lc $2 || '';
- $prefix =~ s/\:\:/\//g;
+ my $prefix;
+ if ($class =~ /^.*::([MVC]|Model|View|Controller)?::(.*)$/) {
+ $prefix = lc $2;
+ $prefix =~ s/\:\:/\//g;
+ }
return $prefix;
}