[Catalyst] New built in action!

Bill Moseley moseley at hank.org
Sat Oct 22 16:07:21 CEST 2005


On Sat, Oct 22, 2005 at 01:42:12PM +0200, Sebastian Riedel wrote:
> We (mostly Matt) just finished the new dispatcher, so we were able to  
> implement a new feature many of you requested.
> 
> The "index" action! :)

So in a App::C::Admin::Users, a controller for dealing with Users:

    sub index : Private {
        [show a list of users]
    }

And then this request shows a list of users.

    /admin/users

> This action is much like "default" but doesn't take arguments and is  
> weighted a bit higher.
> So the new order is "normal action", "index", "default".

Doesn't take arguments in that you can't do:

    sub index : Private {
        my ($self, $c, @args ) = @_;
    }

You can do that with default, but @args is the full path from root,
regardless of which controller default is in.


So if it doesn't take a list of arguments does that mean:

    /admin/users/12

can't be then used show user number 12?

And if later I defined in:

    package App::C::Admin;

    sub users : Local {}

that will then override App::C::Admin::Users::index?

It's still pre-coffee time for me, but how is index different from how
default works?


-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list