Commit | Line | Data |
c4057ce2 |
1 | package MyApp1::Controller::C1; |
2 | |
3 | use Moose; |
4 | use CatalystX::Routes; |
5 | |
69d9fc4e |
6 | BEGIN { extends 'Catalyst::Controller' } |
c4057ce2 |
7 | |
69d9fc4e |
8 | our %REQ; |
9 | |
10 | sub _get { $REQ{get}++ } |
11 | sub _get_html { $REQ{get_html}++ } |
12 | sub _post { $REQ{post}++ } |
13 | sub _put { $REQ{put}++ } |
14 | sub _del { $REQ{delete}++ } |
c4057ce2 |
15 | |
16 | get '/foo' => \&_get; |
17 | |
18 | get_html '/foo' => \&_get_html; |
19 | |
20 | post '/foo' => \&_post; |
21 | |
22 | put '/foo' => \&_put; |
23 | |
24 | del '/foo' => \&_del; |
25 | |
77d62699 |
26 | get 'bar'=> \&_get; |
27 | |
28 | get_html 'bar'=> \&_get_html; |
29 | |
30 | post 'bar'=> \&_post; |
31 | |
32 | put 'bar'=> \&_put; |
33 | |
34 | del 'bar'=> \&_del; |
35 | |
69d9fc4e |
36 | sub normal : Chained('/') : Args(0) { |
37 | $REQ{normal}++; |
38 | } |
39 | |
c4057ce2 |
40 | 1; |