| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Dancer2::Controllers::Controller; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
2364541
|
use Moose; |
|
|
4
|
|
|
|
|
11
|
|
|
|
4
|
|
|
|
|
28
|
|
|
4
|
4
|
|
|
4
|
|
35905
|
use MooseX::MethodAttributes; |
|
|
4
|
|
|
|
|
259642
|
|
|
|
4
|
|
|
|
|
27
|
|
|
5
|
4
|
|
|
4
|
|
516123
|
use namespace::clean; |
|
|
4
|
|
|
|
|
10
|
|
|
|
4
|
|
|
|
|
30
|
|
|
6
|
4
|
|
|
4
|
|
4388
|
use Dancer2; |
|
|
4
|
|
|
|
|
3945189
|
|
|
|
4
|
|
|
|
|
32
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
1; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=encoding utf8 |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Dancer2::Controllers::Controller |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
L<Moose> base class for creating controllers. |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 EXAMPLE |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
package MyApp::Controller; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Moose; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
BEGIN { extends 'Dancer2::Controllers::Controller' } |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub hello_world : Route(get => /) { |
|
31
|
|
|
|
|
|
|
"Hello World!"; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 API |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 Route attribute |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package MyApp::Controller; |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
use Moose; |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
BEGIN { extends 'Dancer2::Controllers::Controller' } |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub hello_world : Route(get => /) { |
|
47
|
|
|
|
|
|
|
"Hello World!"; |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub foo : Route(get => /foo/bar/:id[Int]) { |
|
51
|
|
|
|
|
|
|
shift->request->params->{id}; |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
The route attribute is used to defined Dancer2 routes. |
|
55
|
|
|
|
|
|
|
|