filament-uno / json-request-bundle
Symfony JsonRequest Bundle
Installs: 2 218
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: ^7.3
- symfony/framework-bundle: ^4.3||^5.0
Requires (Dev)
- phpunit/php-code-coverage: ^5.0
- phpunit/phpunit: ^6.4
- symfony/phpunit-bridge: ^4.3||^5.0
- symfony/yaml: ^4.3||^5.0
This package is auto-updated.
Last update: 2022-09-06 13:44:25 UTC
README
This is a copy of the Original SymfonyBundles JsonRequest bundle, with commit fa0e3d252c244aea89ef44866c404b29cfd6dc4c as base. I will try to keep this up to date, but I won't be actively adding new features to this bundle.
Please use the original bundle: https://github.com/symfony-bundles/json-request-bundle
What is JsonRequest Bundle?
This bundle will help you to work with json requests as standard requests without using «crutches».
If previously for fetching of data from the request you did like this:
$data = json_decode($request->getContent())
,
it is now in this already there is no need to.
For example when sending json-request from AngularJS, Vue.js or etc. Early:
public function indexAction(Request $request) { $data = json_decode($request->getContent(), true); // uses request data $name = isset($data['name']) ? $data['name'] : null; }
Now you can work with json-request as with standard request:
public function indexAction(Request $request) { $name = $request->get('name'); }
Installation
- Require the bundle with composer:
composer require filament-uno/json-request-bundle