warnings;
use Moose; # Catalyst::View;
extends 'Catalyst::View::TT';
our $VERSION = '0.04';
use JSON;
around 'render' => sub {
my ($meth, $orig, $c, $template, $args) = (@_, $_[2]->stash());
my (
($c->stash->{JSON}) {
my $body = $self->build_json($c, $c->stash->{JSON});
$body->{html} = $output;
$output = JSON->new->encode($body);
$c->response->content_type("application/json; charset=UT
ault);
}
}
$c->response->body($output);
return 1;
}
sub build_json {
my ($self, $c, $json) = @_;
return ref $json ? $json : {};
}
1;
__END__
=head1 NAME
Catalyst::View::TT::Progressive -