move the test app into the examples directory
[scpubgit/Test-Harness-Selenium.git] / examples / THSelenium-Test / lib / THSelenium / Test / Controller / Root.pm
CommitLineData
4e138785 1package THSelenium::Test::Controller::Root;
2use Moose;
3use namespace::autoclean;
4
5BEGIN { extends '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
15THSelenium::Test::Controller::Root - Root Controller for THSelenium::Test
16
17=head1 DESCRIPTION
18
19[enter your description here]
20
21=head1 METHODS
22
23=head2 index
24
25The root page (/)
26
27=cut
28
29sub index :Path :Args(0) {
30 my ($self, $c) = @_;
31 $c->stash->{template} = 'index.tt';
32}
33
34sub basic :Path('/basic') :Args(0) {
35 my ( $self, $c ) = @_;
36 $c->stash->{template} = 'basic.tt';
37}
38
39sub echo :Path('/echo') :Args(0) {
40 my ($self, $c) = @_;
41 if(my $query = $c->req->params->{query}) {
42 $c->stash->{query} = $query;
43 }
44 $c->stash->{template} = 'echo.tt';
45}
46
47=head2 default
48
49Standard 404 error page
50
51=cut
52
53sub default :Path {
54 my ( $self, $c ) = @_;
55 $c->response->body( 'Page not found' );
56 $c->response->status(404);
57}
58
59=head2 end
60
61Attempt to render a view, if needed.
62
63=cut
64
65sub end : ActionClass('RenderView') {}
66
67=head1 AUTHOR
68
69&
70
71=head1 LICENSE
72
73This library is free software. You can redistribute it and/or modify
74it under the same terms as Perl itself.
75
76=cut
77
78__PACKAGE__->meta->make_immutable;
79
801;