2 # Catlyst::Action::Serialize::YAML::HTML.pm
3 # Created by: Adam Jacob, Marchex, <adam@hjksolutions.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 ) = @_;
22 $controller->config->{'serialize'} ?
23 $controller->config->{'serialize'}->{'stash_key'} :
24 $controller->config->{'stash_key'}
26 my $app = $c->config->{'name'} || '';
27 my $output = "<html>";
28 $output .= "<title>" . $app . "</title>";
29 $output .= "<body><pre>";
30 my $text = Dump($c->stash->{$stash_key});
31 # Straight from URI::Find
32 my $finder = URI::Find->new(
34 my($uri, $orig_uri) = @_;
37 $newuri = $uri . "&content-type=text/html";
39 $newuri = $uri . "?content-type=text/html";
41 return qq|<a href="$newuri">$orig_uri</a>|;
43 $finder->find(\$text);
48 $c->response->output( $output );