Actually add the new bits for rearranged apps
[catagits/Test-WWW-Mechanize-Catalyst.git] / t / lib / ExternalCatty / Controller / Root.pm
1 package ExternalCatty::Controller::Root;
2 use strict;
3 use warnings;
4
5 use base qw/ Catalyst::Controller /;
6
7 __PACKAGE__->config( namespace => '' );
8
9 sub default : Private {
10     my ( $self, $c ) = @_;
11     $c->response->content_type('text/html; charset=utf-8');
12     $c->response->output( html( 'Root', 'Hello, test ☺!' ) );
13 }
14
15 # redirect to a redirect
16 sub hello: Global {
17     my ( $self, $context ) = @_;
18     my $where = $context->uri_for('/');
19     $context->response->redirect($where);
20     return;
21 }
22
23 sub html {
24     my ( $title, $body ) = @_;
25     return qq[
26 <html>
27 <head>
28     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29     <title>$title</title>
30 </head>
31 <body>$body</body>
32 </html>
33 ];
34 }
35
36 1;
37