Refactored the Content-Type negotiation to live in Catalyst::Request::REST.(drolsky)
[catagits/Catalyst-Action-Serialize-Data-Serializer.git] / lib / Catalyst / Action / Serialize / View.pm
1 package Catalyst::Action::Serialize::View;
2 use strict;
3 use warnings;
4
5 use base 'Catalyst::Action';
6
7 sub execute {
8     my $self = shift;
9     my ( $controller, $c, $view ) = @_;
10     my $stash_key = $controller->config->{'serialize'}->{'stash_key'}
11       || 'rest';
12
13     if ( !$c->view($view) ) {
14         $c->log->error("Could not load $view, refusing to serialize");
15         return 0;
16     }
17
18     return $c->view($view)->process($c);
19 }
20
21 1;