MVC::Neaf::View::JS - JSON-based view for Not Even A Framework.
See MVC::Neaf.
use MVC::Neaf; # define route ... sub { return { # your data ... -view => 'JS', # this is the default as of 0.20 -jsonp => 'my.jsonp.callback', # this is optional } };
Will result in your application returning raw data in JSON/JSONP format instead or rendering a template.
%options may include:
want_pretty - sort keys & indent output
want_sorted - sort keys (this defaults to want_pretty)
preserve_dash - don't strip dashed options. Useful for debugging.
Returns a scalar with JSON-encoded data.
This module is part of MVC::Neaf suite.
Copyright 2016-2018 Konstantin S. Uvarin khedin@cpan.org.
khedin@cpan.org
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install MVC::Neaf, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MVC::Neaf
CPAN shell
perl -MCPAN -e shell install MVC::Neaf
For more information on module installation, please visit the detailed CPAN module installation guide.