[Catalyst] url parsing and sub controller

Bernard FRIT bernard.frit at gmail.com
Mon Sep 5 18:00:52 CEST 2005


Probably a dumb question ...

I have a controller
MyApp::C::Categ

with

sub default :  Private {
    my ( $self, $c ) = @_;
    $c->res->redirect('/default_action');
}

sub begin : Private {
    my ( $self, $c , $categ) = @_;
    if ($categ) {
       $c->stash->{title} = "Category = $categ";
       return 1;
    }
}

when typing "domaine.tld /categ/MyCategory" I was expecting having
$categ = MyCategory but I only have $categ=categ so I needed
    my ( $self, $c , $dummy, $categ) = @_;
to get the correct value. Is it correct behavior ?

More, I can't figure out why after executing begin, Catalyst execute
default and redirect to "/default_action" ?

--
Bernard FRIT still unbrainedly trying to understand...



More information about the Catalyst mailing list