kumatch / silex-json-body-provider
A Silex service provider for JSON body parsing.
Installs: 2 478
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.3
- silex/silex: 1.*
Requires (Dev)
- phpunit/phpunit: 3.*
- symfony/browser-kit: 2.*
This package is not auto-updated.
Last update: 2024-12-17 04:46:32 UTC
README
A Silex service provider for JSON body parsing. See silex cookbook. http://silex.sensiolabs.org/doc/cookbook/json_request_body.html
Install
$ composer require kumatch/silex-json-body-provider
Example
<?php use Silex\Application; use Kumatch\Silex\JsonBodyProvider; $app = new Application(); $app->register(new JsonBodyProvider()); // ex. post JSON '{"value":42}' $app->post("/", function (Request $req) { $value = $req->request->get("value"); // 42 });
License
Licensed under the MIT License.