root/lang/perl/Chaostr/trunk/lib/Chaostr/Web/Base/Controller.pm

Revision 9874, 1.6 kB (checked in by vkgtaro, 8 months ago)

lang/perl/Chaostr:

  • Schema::Timeline に create_from_fv を生やした
  • Base::Controller 追加
  • Controller::Texts 追加
Line 
1package Chaostr::Web::Base::Controller;
2
3use strict;
4use warnings;
5use base 'Catalyst::Controller::Resource';
6use Catalyst::Utils;
7
8
9# __PACKAGE__->config(
10#     collection => {
11#         list        => { method => 'GET',  path => '' },
12#         create      => { method => 'POST', path => '' },
13#         create_form => { method => 'GET',  path => 'new' },
14#     },
15#     member => {
16#         show         => { method => 'GET',  path => '' },
17#         update       => { method => 'POST', path => 'update' },
18#         update_form  => { method => 'GET',  path => 'update' },
19#         destroy      => { method => 'POST', path => 'delete' },
20#         destroy_form => { method => 'GET',  path => 'delete' },
21#         edit         => { method => 'GET',  path => 'edit' },
22#         edit_form    => { method => 'GET',  path => 'edit' },
23#     },
24# );
25
26sub setup_collection_actions {
27    my $self = shift;
28
29    my $maps = Catalyst::Utils::merge_hashes($self->{collection} || {}, {
30        list      => { method => 'GET',  path => '' },
31        do_create => { method => 'POST', path => '' },
32        create    => { method => 'GET',  path => 'new' },
33    });
34    $self->setup_actions(collection => $maps);
35}
36
37sub setup_member_actions {
38    my $self = shift;
39
40    my $maps = Catalyst::Utils::merge_hashes($self->{member} || {}, {
41        show       => { method => 'GET',  path => '' },
42        do_update  => { method => 'POST', path => 'update' },
43        update     => { method => 'GET',  path => 'update' },
44        do_destroy => { method => 'POST', path => 'delete' },
45        destroy    => { method => 'GET',  path => 'delete' },
46    });
47    $self->setup_actions(member => $maps);
48}
49
501;
Note: See TracBrowser for help on using the browser.