NAME

App::Manoc::View::JSON

VERSION

version 2.99.2

SYNOPSIS

sub list_js : Chained('object_list') : PathPart('js') : Args(0) {
  my ( $self, $c ) = @_;

  $c->stash( json_data => \@my_list );
  $c->forward('View::JSON');
}

NAME

App::Manoc::View::JSON - Catalyst JSON View

sub encode_json { my ( $self, $c, $data ) = @_;

if ( not defined($data) ) {
    $c->response->status(403);
    $c->detach();
    return;
}

my $encoder = JSON->new->utf8();
$encoder->allow_blessed(1);
$encoder->convert_blessed(1);
return $encoder->encode($data);
}

SEE ALSO

Catalyst::View::JSON

AUTHORS

  • Gabriele Mambrini <gmambro@cpan.org>

  • Enrico Liguori

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Gabriele Mambrini.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.