kumatch/silex-json-body-provider

A Silex service provider for JSON body parsing.

Installs: 2 481

Dependents: 2

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/kumatch/silex-json-body-provider

0.1.0 2014-12-08 14:59 UTC

This package is not auto-updated.

Last update: 2025-10-07 09:30:00 UTC


README

A Silex service provider for JSON body parsing. See silex cookbook. http://silex.sensiolabs.org/doc/cookbook/json_request_body.html

Build Status

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.