2017 © Pedro Peláez
 

library silex-jsonp

Content type aware JSON response handler for Silex

image

kbrabrand/silex-jsonp

Content type aware JSON response handler for Silex

  • Wednesday, February 18, 2015
  • by kbrabrand
  • Repository
  • 2 Watchers
  • 1 Stars
  • 285 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

JSONP provider for Silex

Content type aware JSON response handler for Silex, (*1)

Build Status, (*2)

Installation

Add "kbrabrand/silex-jsonp": "XXX" to the composer.json file inside your project and do a composer install. Check [Composer][1] for the latest available version., (*3)

Setup instructions

Register the JSONP service provider in your Silex app like this;, (*4)

use KBrabrand\Silex\Provider\JSONPServiceProvider;

$app->register(new JSONPServiceProvider(), array(
    'JSONP.callback'     => 'cb',                 // GET parameter containing the callback method name (optional)
    'JSONP.contentTypes' => ['application/json'], // List of response content types to use with JSONP (optional)
));

Usage

After registering the JSONP service provider an after hook will be added and the response content will be modified before it's returned to the user if the URL contains a callback and the content type of the response is in the list of allowed content types., (*5)

Tests

The service provider comes with PHPUnit tests and can be run by doing a ./vendor/phpunit/phpunit/phpunit inside the silex-jsonp folder., (*6)

License

License Copyright (c) 2015, Kristoffer Brabrand kristoffer@brabrand.no, (*7)

Licensed under the MIT License, (*8)

The Versions

18/02 2015

dev-master

9999999-dev

Content type aware JSON response handler for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristoffer Brabrand

07/01 2015

1.0.1

1.0.1.0

Content type aware JSON response handler for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristoffer Brabrand

06/01 2015

1.0.0

1.0.0.0

Content type aware JSON response handler for Silex

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kristoffer Brabrand