2 # Catlyst::Action::Serialize::YAML::HTML.pm
3 # Created by: Adam Jacob, Marchex, <adam@marchex.com>
4 # Created on: 10/12/2006 03:00:32 PM PDT
8 package Catalyst::Action::Serialize::YAML::HTML;
13 use base 'Catalyst::Action';
19 my ( $controller, $c ) = @_;
21 my $stash_key = $controller->config->{'serialize'}->{'stash_key'} || 'rest';
22 my $app = $c->config->{'name'} || '';
23 my $output = "<html>";
24 $output .= "<title>" . $app . "</title>";
25 $output .= "<body><pre>";
26 my $text = Dump($c->stash->{$stash_key});
27 # Straight from URI::Find
28 my $finder = URI::Find->new(
30 my($uri, $orig_uri) = @_;
33 $newuri = $uri . "&content-type=text/html";
35 $newuri = $uri . "?content-type=text/html";
37 return qq|<a href="$newuri">$orig_uri</a>|;
39 $finder->find(\$text);
44 $c->response->output( $output );