mauro-moreno/silex-jsonapi

JSONApi.org implementation for Silex framework.

Installs: 59

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/mauro-moreno/silex-jsonapi

2.0.2 2016-09-05 13:20 UTC

This package is auto-updated.

Last update: 2025-09-29 01:26:31 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);