1 package Catalyst::Action::Serialize::YAML::HTML;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
12 my ( $controller, $c ) = @_;
15 $controller->{'serialize'} ?
16 $controller->{'serialize'}->{'stash_key'} :
17 $controller->{'stash_key'}
19 my $app = $c->config->{'name'} || '';
20 my $output = "<html>";
21 $output .= "<title>" . $app . "</title>";
22 $output .= "<body><pre>";
23 my $text = Dump($c->stash->{$stash_key});
24 # Straight from URI::Find
25 my $finder = URI::Find->new(
27 my($uri, $orig_uri) = @_;
30 $newuri = $uri . "&content-type=text/html";
32 $newuri = $uri . "?content-type=text/html";
34 return qq|<a href="$newuri">$orig_uri</a>|;
36 $finder->find(\$text);
41 $c->response->output( $output );