NAME
Dancer2::Controllers::Controller
SYNOPSIS
Moose base class for creating controllers.
EXAMPLE
package MyApp::Controller;
use Moose;
BEGIN { extends 'Dancer2::Controllers::Controller' }
sub hello_world : Route(get => /) {
"Hello World!";
}
1;
API
Route attribute
package MyApp::Controller;
use Moose;
BEGIN { extends 'Dancer2::Controllers::Controller' }
sub hello_world : Route(get => /) {
"Hello World!";
}
sub foo : Route(get => /foo/bar/:id[Int]) {
shift->request->params->{id};
}
The route attribute is used to defined Dancer2 routes.