source: trunk/lib/Vote/Controller/Root.pm @ 198

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 
1package Vote::Controller::Root;
2
3use strict;
4use warnings;
5use 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
15Vote::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
29sub begin : Private {
30    my ( $self, $c ) = @_;
31    $c->model('Vote')->rollback;
32}
33
34sub default : Private {
35    my ( $self, $c ) = @_;
36    $c->stash->{page}{title} = 'Epoll ' . $Vote::VERSION;
37}
38
39=head2 end
40
41Attempt to render a view, if needed.
42
43=cut 
44
45sub 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
53Thauvin Olivier
54
55=head1 LICENSE
56
57This library is free software, you can redistribute it and/or modify
58it under the same terms as Perl itself or CeCILL.
59
60=cut
61
621;
Note: See TracBrowser for help on using the repository browser.