fixed Bar Controller, tons of bugs everywhere, restructured controller namespace
[catagits/Reaction.git] / lib / ComponentUI / Controller / Root.pm
CommitLineData
7adfd53f 1package ComponentUI::Controller::Root;
2
3use strict;
4use warnings;
89b70ba7 5use base 'Reaction::UI::Controller::Root';
7adfd53f 6use Reaction::Class;
7
8use aliased 'Reaction::UI::ViewPort';
9
10#
11# Sets the actions in this controller to be registered with no prefix
12# so they function identically to actions created in MyApp.pm
13#
14__PACKAGE__->config(
6ab43711 15 view_name => 'Site',
7adfd53f 16 window_title => 'Reaction Test App',
6ab43711 17 namespace => ''
7adfd53f 18);
19
20sub base :Chained('/') :PathPart('') :CaptureArgs(0) {
21 my ($self, $c) = @_;
6ab43711 22 $self->push_viewport(ViewPort, layout => 'layout');
7adfd53f 23}
24
25sub root :Chained('base') :PathPart('') :Args(0) {
26 my ($self, $c) = @_;
27 $self->push_viewport(ViewPort, layout => 'index');
28}
29
6ab43711 30sub static :Chained('base') :PathPart('static') :Args {
31 my ($self, $c, @args) = @_;
32 return if $c->stash->{window}->view->serve_static_file($c, \@args);
33 $c->forward('error_404');
34}
35
36sub error_404 :Private {
37 my ($self, $c) = @_;
38 $c->res->body("Error 404");
39 $c->res->status(404);
40}
41
7adfd53f 421;