package Egg::Plugin::JSON;
#
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
#
# $Id: JSON.pm 189 2007-08-08 01:43:47Z lushe $
#
use strict;
use warnings;
use FileHandle;
use JSON;
use Carp qw/croak/;
VERSION = '0.01';
=head1 NAME
Egg::Release::JSON - JSON for Egg::Plugin.
=head1 SYNOPSIS
Controller.
use Egg qw/ JSON /;
Example code.
my $json_data = {
aaaaa => 'bbbbb',
ccccc => '
conversion of JSON data.
#
my $json_js = $e->obj2json($json_data);
my $json_hash = $e->json2obj($json_js);
#
# The JSON module object is acquired.
#
my $json= $e->json;
=head1 DESC
::JSON;
#
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
#
# $Id: JSON.pm 210 2007-11-03 14:38:29Z lushe $
#
use strict;
use warnings;
our $VERSION = '0.02';
=head1 NAME
Egg::Release::JSON - JSON
RIPTION
VIEW and PLUGIN to use JSON are enclosed.
=head1 EXAMPLE
=head2 VIEW
Defolt VIEW is set and the output preparation of JSON is done.
$e->default_view('JSON')->obj({
hogehoge => 'hooo
::JSON> in detail.
=head2 PLUGIN
The method for the mutual conversion of JSON is added.
my $json_data = {
aaaaa => 'bbbbb',
ccccc => 'ddddd',
};
my $json_js = $e->obj2json($json_d
:View::JSON;
#
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
#
# $Id: JSON.pm 189 2007-08-08 01:43:47Z lushe $
#
use strict;
use warnings;
use Carp qw/croak/;
use base qw/Egg::View/;
use JSON;
our
=head1 NAME
Egg::Release::JSON - JSON for Egg::View.
=head1 SYNOPSIS
Configuration.
VIEW => [
.....
[ JSON => {
content_type => 'text/javascript+json',
charset => 'UTF-8',
t_view('JSON')->obj({
hoge=> 'boo',
baaa=> 'wii',
});
* It leaves it to the operation of Egg now.
=head1 DESCRIPTION
It is VIEW to output JSON.
JSON is output by the 'objToJson' functi