3 # Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
5 package TestApp::Controller::Root;
6 use base qw(Catalyst::Controller);
7 __PACKAGE__->config->{namespace} = q{};
8 my @words = qw(foo bar baz bat qux quux);
11 my ($self, $c, @args) = @_;
12 my $words = $c->uri_for('/words');
13 $c->response->body(<<"HERE");
16 <title>TestApp</title>
20 <p>This is the TestApp.</p>
21 <p><a href="$words">Click here</a> to <i>see</i> some words.</p>
28 my ($self, $c, $times) = @_;
30 my $html = <<"HEADER";
33 <title>TestApp</title>
36 <h1>TestApp << Words</h1>
37 <p>Here you'll find all things "words" printed $times time(s)!</p>
40 local $" = q{ }; # single space
41 $html .= " <li>$_: @words</li>\n" for 1..$times;
47 $c->response->body($html);
50 sub null : Path('/favicon.ico'){
52 $c->response->status(404); # doesn't exist