0.60 release branch
[catagits/Catalyst-Action-REST.git] / lib / Catalyst / Action / Serialize / View.pm
CommitLineData
9a76221e 1package Catalyst::Action::Serialize::View;
2use strict;
3use warnings;
4
5use base 'Catalyst::Action';
6
7sub 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
211;