1 package Catalyst::Action::Serialize::YAML::HTML;
4 use namespace::autoclean;
6 extends 'Catalyst::Action';
10 our $VERSION = '0.89';
11 $VERSION = eval $VERSION;
15 my ( $controller, $c ) = @_;
18 $controller->{'serialize'} ?
19 $controller->{'serialize'}->{'stash_key'} :
20 $controller->{'stash_key'}
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 );
48 __PACKAGE__->meta->make_immutable;