JSON;
use strict;
use warnings;
use JSON;
use base 'Template::Flute::Iterator';
=head1 NAME
Template::Flute::Iterator::JSON - Iterator class for JSON strings and files
=head1 SYNOPSIS
$json
pg"}
]};
$json_iter = Template::Flute::Iterator::JSON->new($json);
$json_iter->next();
$json_iter_file = Template::Flute::Iterator::JSON->new(file => 'fruits.json');
=head1 DESCRIP
:Flute::Iterator::JSON is a subclass of L<Template::Flute::Iterator>.
=head1 CONSTRUCTOR
=head2 new
Creates an Template::Flute::Iterator::JSON object from a JSON string.
The JSON string can be eit
ackage Template::Flute::Filter::JsonVar;
use strict;
use warnings;
use base 'Template::Flute::Filter';
use JSON;
=head1 NAME
Template::Flute::Filter::JsonVar - JSON to Javascript variable filter
structure or a JSON string and returns Javascript
which parses the JSON string with Jquery and assigns it to
the variable C<json>.
The following example shows you how to inject the JSON variable
into
t/javascript" id="vars"></script>
XML Specification:
<value name="jsvars" id="vars" filter="json_var"/>
Values for L<Template::Flute>:
Template::Flute->new(...,
values => {jsvars =
License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
=head1 SEE ALSO
L<Template::Flute::Iterator::JSON>
=cut
1;
anguageName>.
Requires L<Locales> module.
=item json_var
JSON to Javascript variable filter, see L<Template::Flute::Filter::JsonVar>.
Requires L<JSON> module.
=item lower_dash
Replaces spaces with
ix.
Thanks to Jeff Boes for spotting a typo in the documentation of the
Template::Flute::Filter::JsonVar class.
Thanks to Ton Verhagen for being a big supporter of my projects in all aspects.
Thank