[Catalyst] Did $c->req->arguments processing change?

Bill Moseley moseley at hank.org
Fri Nov 11 07:39:28 CET 2005


I'm trying to stay away from using default, but I have one controller
where I still (try to) use default() like a normal/local action.

On a default action the arguments include all the path segments, not
just the parts after the "namespace".

So to make it work like other actions I was shifting off the
controller's namespace -- leaving just the arguments.  Basically
doing this in an auto:

    my @namespace = split m!/!, $c->action->namespace;
    splice @{$c->req->arguments}, 0, @namespace;

(although I was not using the handy $c->action->namespace).

But that doesn't seem to have any effect any more.  That is

    my $array = $c->req->arguments;
    push @$array, "extra stuff";

doesn't modify arguments.


My fix is adding dummy arguments, something ugly like this for a
two-level namespace:

sub default : Private {
    my ( $self, $c, $dummy, $dummy2, $table, $id, $action ) = @_;



I need to look at this again.  Why doesn't it take arguments?

       * index : Private
           "index" is much like "default" except that it takes no arguments and
           it is weighted slightly higher in the matching process.





-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list