]> ruin.nu Git - ndwebbie.git/blob - lib/NDWeb/Controller/Root.pm
Added model and renamed submodule
[ndwebbie.git] / lib / NDWeb / Controller / Root.pm
1 package NDWeb::Controller::Root;
2
3 use strict;
4 use warnings;
5 use parent '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 NDWeb::Controller::Root - Root Controller for NDWeb
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 index : Local Path Args(0) {
30     my ( $self, $c ) = @_;
31
32         $c->stash(abc => $c->req->base);
33 }
34
35 sub default : Path {
36     my ( $self, $c ) = @_;
37         $c->res->body( 'Page not found' );
38     $c->response->status(404);
39     
40 }
41
42 sub auto : Private {
43         my ($self, $c) = @_;
44
45         my $dbh = $c ->model;
46         $c->stash(dbh => $dbh);
47
48         $c->stash->{game}->{tick} = $dbh->selectrow_array('SELECT tick()',undef);
49
50 }
51
52 =head2 end
53
54 Attempt to render a view, if needed.
55
56 =cut 
57
58 sub end : ActionClass('RenderView') {}
59
60 =head1 AUTHOR
61
62 Catalyst developer
63
64 =head1 LICENSE
65
66 This library is free software, you can redistribute it and/or modify
67 it under the same terms as Perl itself.
68
69 =cut
70
71 1;