Skip to content

mauro-moreno/silex-jsonapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silex JSON Api

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);

About

JSONApi.org implementation for Silex framework.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages