Last change
on this file since 198 was
198,
checked in by nanardon, 15 years ago
|
- use new commit() and rollback()
- add add standalone create_poll function
|
File size:
986 bytes
|
Line | |
---|
1 | package Vote::Controller::Root; |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use base 'Catalyst::Controller'; |
---|
6 | |
---|
7 | # |
---|
8 | # Sets the actions in this controller to be registered with no prefix |
---|
9 | # so they function identically to actions created in MyApp.pm |
---|
10 | # |
---|
11 | __PACKAGE__->config->{namespace} = ''; |
---|
12 | |
---|
13 | =head1 NAME |
---|
14 | |
---|
15 | Vote::Controller::Root - Root Controller for Vote |
---|
16 | |
---|
17 | =head1 DESCRIPTION |
---|
18 | |
---|
19 | [enter your description here] |
---|
20 | |
---|
21 | =head1 METHODS |
---|
22 | |
---|
23 | =cut |
---|
24 | |
---|
25 | =head2 default |
---|
26 | |
---|
27 | =cut |
---|
28 | |
---|
29 | sub begin : Private { |
---|
30 | my ( $self, $c ) = @_; |
---|
31 | $c->model('Vote')->rollback; |
---|
32 | } |
---|
33 | |
---|
34 | sub default : Private { |
---|
35 | my ( $self, $c ) = @_; |
---|
36 | $c->stash->{page}{title} = 'Epoll ' . $Vote::VERSION; |
---|
37 | } |
---|
38 | |
---|
39 | =head2 end |
---|
40 | |
---|
41 | Attempt to render a view, if needed. |
---|
42 | |
---|
43 | =cut |
---|
44 | |
---|
45 | sub end : Private { |
---|
46 | my ($self, $c) = @_; |
---|
47 | if ($c->res->body) { return } |
---|
48 | else { $c->forward(qw/Vote::View::TT/) } |
---|
49 | } |
---|
50 | |
---|
51 | =head1 AUTHOR |
---|
52 | |
---|
53 | Thauvin Olivier |
---|
54 | |
---|
55 | =head1 LICENSE |
---|
56 | |
---|
57 | This library is free software, you can redistribute it and/or modify |
---|
58 | it under the same terms as Perl itself or CeCILL. |
---|
59 | |
---|
60 | =cut |
---|
61 | |
---|
62 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.