add new view "JSON"

agranig/1_0_subfix
Gerhard Jungwirth 12 years ago
parent 7ed2dccb52
commit a9808ee53f

@ -16,6 +16,7 @@ requires 'Catalyst::Action::RenderView';
requires 'Moose'; requires 'Moose';
requires 'namespace::autoclean'; requires 'namespace::autoclean';
requires 'Config::General'; # This should reflect the config file format you've chosen requires 'Config::General'; # This should reflect the config file format you've chosen
requires 'Catalyst::Helper::View::JSON'
# See Catalyst::Plugin::ConfigLoader for supported formats # See Catalyst::Plugin::ConfigLoader for supported formats
requires 'Log::Log4perl::Catalyst'; requires 'Log::Log4perl::Catalyst';
test_requires 'Test::More' => '0.88'; test_requires 'Test::More' => '0.88';

@ -53,6 +53,11 @@ __PACKAGE__->config(
], ],
ABSOLUTE => 1, ABSOLUTE => 1,
}, },
'View::JSON' => {
#Set the stash keys to be exposed to a JSON response
#(sEcho iTotalRecords iTotalDisplayRecords aaData) for datatables
expose_stash => [ qw(sEcho iTotalRecords iTotalDisplayRecords aaData) ],
},
'Plugin::Static::Simple' => { 'Plugin::Static::Simple' => {
include_path => [ include_path => [
@ -135,6 +140,7 @@ __PACKAGE__->config(
} }
} }
); );
__PACKAGE__->config( default_view => 'HTML' );
__PACKAGE__->log(Log::Log4perl::Catalyst->new('ngcp_panel.conf')); __PACKAGE__->log(Log::Log4perl::Catalyst->new('ngcp_panel.conf'));

@ -0,0 +1,29 @@
package NGCP::Panel::View::JSON;
use strict;
use base 'Catalyst::View::JSON';
=head1 NAME
NGCP::Panel::View::JSON - Catalyst JSON View
=head1 SYNOPSIS
See L<NGCP::Panel>
=head1 DESCRIPTION
Catalyst JSON View.
=head1 AUTHOR
Gerhard,,,
=head1 LICENSE
This library is free software, you can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
1;

@ -0,0 +1,8 @@
use strict;
use warnings;
use Test::More;
BEGIN { use_ok 'NGCP::Panel::View::JSON' }
done_testing();
Loading…
Cancel
Save