]> Dogcows Code - chaz/chatty/blob - lib/Chatty/View/JSON.pm
use a json view instead of writing json directly
[chaz/chatty] / lib / Chatty / View / JSON.pm
1 package Chatty::View::JSON;
2
3 use JSON::XS ();
4
5 use Moose;
6 use MooseX::NonMoose;
7 use namespace::autoclean;
8
9 extends 'Catalyst::View::JSON';
10
11 sub encode_json {
12 my ($self, $c, $data) = @_;
13 JSON::XS->new->ascii->pretty->allow_nonref->encode($data);
14 }
15
16 =head1 NAME
17
18 Chatty::View::JSON - Catalyst View
19
20 =head1 DESCRIPTION
21
22 Catalyst View.
23
24 =head1 AUTHOR
25
26 Charles McGarvey
27
28 =head1 LICENSE
29
30 This library is free software. You can redistribute it and/or modify
31 it under the same terms as Perl itself.
32
33 =cut
34
35 __PACKAGE__->meta->make_immutable;
36
37 1;
This page took 0.030325 seconds and 4 git commands to generate.