}
$c->{depth}++;
eval {
- if ( $c->debug )
- {
+ if ( $c->debug ) {
my ( $elapsed, @state ) =
$c->benchmark( $code, $class, $c, @{ $c->req->args } );
push @{ $c->{stats} }, [ $action, sprintf( '%fs', $elapsed ) ];
$c->state(@state);
}
- else { $c->state( &$code( $class, $c, @{ $c->req->args } ) || 0 ) }
+ else {
+ $c->state( &$code( $class, $c, @{ $c->req->args } ) || 0 )
+ }
};
$c->{depth}--;
$c->action( $result->[0] );
$c->namespace( $c->req->path );
$c->req->action('default');
+ # default methods receive the controller name as the first argument
+ unshift @{ $c->req->args }, ( split /\//, $result->[0] )[0];
$c->req->match('');
return 1;
}