Fix mixed CRLFs
[catagits/Test-WWW-Selenium-Catalyst.git] / t / lib / TestApp / Controller / Root.pm
CommitLineData
42772875 1#!/usr/bin/perl
2# Root.pm
3# Copyright (c) 2006 Jonathan Rockway <jrockway@cpan.org>
4
5package TestApp::Controller::Root;
6use base qw(Catalyst::Controller);
7__PACKAGE__->config->{namespace} = q{};
8my @words = qw(foo bar baz bat qux quux);
9
10sub index : Private {
11 my ($self, $c, @args) = @_;
12 my $words = $c->uri_for('/words');
13 $c->response->body(<<"HERE");
14<html>
15<head>
16<title>TestApp</title>
17</head>
18<body>
19<h1>TestApp</h1>
20<p>This is the TestApp.</p>
21<p><a href="$words">Click here</a> to <i>see</i> some words.</p>
22</body>
23</html>
24HERE
25}
26
27sub words : Local {
28 my ($self, $c, $times) = @_;
29 $times ||= 0;
30 my $html = <<"HEADER";
31<html>
32<head>
33<title>TestApp</title>
34</head>
35<body>
36<h1>TestApp &lt;&lt; Words</h1>
37<p>Here you'll find all things "words" printed $times time(s)!</p>
38<ul>
39HEADER
40 local $" = q{ }; # single space
41 $html .= " <li>$_: @words</li>\n" for 1..$times;
42 $html .= <<"FOOTER";
43</ul>
44</body>
45</html>
46FOOTER
47 $c->response->body($html);
48}
49
50sub null : Path('/favicon.ico'){
51 my ($self, $c) = @_;
52 $c->response->status(404); # doesn't exist
53}
54
551; # true.
56