Commit | Line | Data |
6ea96b03 |
1 | package TestApp::Controller::Priorities; |
2 | |
3 | use strict; |
4 | use base 'Catalyst::Base'; |
5 | |
6 | # |
7 | # Regex vs. Local |
8 | # |
9 | |
10 | sub re_vs_loc_re :Regex('/priorities/re_vs_loc') { $_[1]->res->body( 'regex' ) } |
11 | sub re_vs_loc :Local { $_[1]->res->body( 'local' ) } |
12 | |
13 | # |
14 | # Regex vs. LocalRegex |
15 | # |
16 | |
17 | sub re_vs_locre_locre :LocalRegex('re_vs_(locre)') { $_[1]->res->body( 'local_regex' ) } |
18 | sub re_vs_locre_re :Regex('/priorities/re_vs_locre') { $_[1]->res->body( 'regex' ) } |
19 | |
20 | # |
21 | # Regex vs. Path |
22 | # |
23 | |
24 | sub re_vs_path_path :Path('/priorities/re_vs_path') { $_[1]->res->body( 'path' ) } |
25 | sub re_vs_path_re :Regex('/priorities/re_vs_path') { $_[1]->res->body( 'regex' ) } |
26 | |
27 | # |
28 | # Local vs. LocalRegex |
29 | # |
30 | |
31 | sub loc_vs_locre_locre :LocalRegex('loc_vs_locre') { $_[1]->res->body( 'local_regex' ) } |
32 | sub loc_vs_locre :Local { $_[1]->res->body( 'local' ) } |
33 | |
34 | # |
35 | # Local vs. Path (depends on definition order) |
36 | # |
37 | |
38 | sub loc_vs_path1_loc :Path('/priorities/loc_vs_path1') { $_[1]->res->body( 'path' ) } |
39 | sub loc_vs_path1 :Local { $_[1]->res->body( 'local' ) } |
40 | |
41 | sub loc_vs_path2 :Local { $_[1]->res->body( 'local' ) } |
42 | sub loc_vs_path2_loc :Path('/priorities/loc_vs_path2') { $_[1]->res->body( 'path' ) } |
43 | |
44 | # |
45 | # Path vs. LocalRegex |
46 | # |
47 | |
48 | sub path_vs_locre_locre :LocalRegex('path_vs_(locre)') { $_[1]->res->body( 'local_regex' ) } |
49 | sub path_vs_locre_path :Path('/priorities/path_vs_locre') { $_[1]->res->body( 'path' ) } |
50 | |
51 | # |
52 | # Regex vs. index (has sub controller) |
53 | # |
54 | |
55 | sub re_vs_idx :Regex('/priorities/re_vs_index') { $_[1]->res->body( 'regex' ) } |
56 | |
57 | # |
58 | # Local vs. index (has sub controller) |
59 | # |
60 | |
61 | sub loc_vs_index :Local { $_[1]->res->body( 'local' ) } |
62 | |
63 | # |
64 | # LocalRegex vs. index (has sub controller) |
65 | # |
66 | |
67 | sub locre_vs_idx :LocalRegex('locre_vs_index') { $_[1]->res->body( 'local_regex' ) } |
68 | |
69 | # |
70 | # Path vs. index (has sub controller) |
71 | # |
72 | |
73 | sub path_vs_idx :Path('/priorities/path_vs_index') { $_[1]->res->body( 'path' ) } |
74 | |
75 | 1; |