mauro-moreno / silex-jsonapi
JSONApi.org implementation for Silex framework.
2.0.2
2016-09-05 13:20 UTC
Requires
- php: >=5.5.9
- nilportugues/json-api: ^2.1
- symfony/psr-http-message-bridge: ~0.2
Requires (Dev)
- phpunit/phpunit: >=5.1
- silex/silex: ^2.0
This package is auto-updated.
Last update: 2024-11-29 01:31:03 UTC
README
JSONApi.org implementation for Silex framework.
Based on Nil Portugués Caldero PHP Json Api Package php-json-api.
Installation
** Step 1: Download Service Provider
To install with composer just open a terminal and type:
$ composer require mauro-moreno/silex-jsonapi
** Step 2: Enable Service Provider
To enable
<?php $app = new Silex\Application; $app['mappers'] = []; // Array of mapping classes $app->register(new MauroMoreno\JsonApi\JsonApiServiceProvider);
Controller
The following JsonApiResponseTrait
methods are provided to return the right headers and HTTP status codes are available:
private function resourceCreated($json); private function resourceDeleted($json); private function resourceNotFound($json); private function resourceProcessing($json); private function resourceUpdatedResponse($json); private function response($json); private function unsupportedAction($json);