This file documents the revision history for Perl extension Catalyst.
5.60
+ - Fixed Path and index actions in the appclass,
+ including those that attach to /
+ - Index is now weighted higher than Path
- Fixed restarter and -d debug switch in server.pl.
- Added a warning if you attempt to retrieve a parameter
using $c->req->params('foo').
my $paths = Text::SimpleTable->new( [ 36, 'Path' ], [ 37, 'Private' ] );
for my $path ( sort keys %{ $self->{paths} } ) {
my $action = $self->{paths}->{$path};
- $paths->row( "/$path", "/$action" );
+ $path = "/$path" unless $path eq '/';
+ $paths->row( "$path", "/$action" );
}
$c->log->debug( "Loaded Path actions:\n" . $paths->draw )
if ( keys %{ $self->{paths} } );
sub match {
my ( $self, $c, $path ) = @_;
+ $path ||= '/';
if ( my $action = $self->{paths}->{$path} ) {
$c->req->action($path);
$c->req->match($path);
foreach my $r ( @{ $attrs->{Path} || [] } ) {
unless ($r) {
$r = $action->namespace;
- $r = '' if $r eq '/';
+ $r = '/' unless $r;
}
elsif ( $r !~ m!^/! ) { # It's a relative path
$r = $action->namespace . "/$r";
sub register_path {
my ( $self, $c, $path, $action ) = @_;
$path =~ s!^/!!;
+ $path = '/' unless $path;
$self->{paths}{$path} = $action;
}
);
# Preload these action types
-our @PRELOAD = qw/Path Regex/;
+our @PRELOAD = qw/Index Path Regex/;
# Postload these action types
-our @POSTLOAD = qw/Index Default/;
+our @POSTLOAD = qw/Default/;
=head1 NAME
my @path = split /\//, $c->req->path;
$c->req->args( \my @args );
- push( @path, '/' ) unless @path; # Root action
+ unshift( @path, '' ); # Root action
DESCEND: while (@path) {
$path = join '/', @path;
+ $path =~ s#^/##;
- $path = '' if $path eq '/'; # Root action
+ $path = '' if $path eq '/'; # Root action
# Check out dispatch types to see if any will handle the path at
# this level
C<index> is much like C<default> except that it takes no arguments
and it is weighted slightly higher in the matching process. It is
useful as a static entry point to a controller, e.g. to have a static
-welcome page.
+welcome page. Note that it's also weighted higher than Path.
=item * B<begin : Private>