bmatzner/json2-bundle
Symfony2 bundle that packages Douglas Crockford’s JSON-js (json2.js, 2013-05-26) for easy inclusion via Composer and asset installation. Provides json2.min.js in your public assets so you can reference it in templates.
JSON-js 2013-05-26 Only the json2.js file crockford is suggesting to use is included
// composer.json
{
"require": {
// ...
"bmatzner/json2-bundle": "*"
}
}
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Bmatzner\Json2Bundle\BmatznerJson2Bundle(),
// ...
);
}
$ php composer.phar update bmatzner/json2-bundle
Given your server's public directory is named "web", install the public vendor resources
$ php app/console assets:install web
Optionally, use the --symlink attribute to create links rather than copies of the resources
$ php app/console assets:install --symlink web
Refer to the desired files in your HTML template, e.g.
<script type="text/javascript" src="{{ asset('bundles/bmatznerjson2/js/json2.min.js') }}"></script>
Refer to the source code of the included files for license information
How can I help you explore Laravel packages today?