PHPackages                             kbrabrand/silex-jsonp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kbrabrand/silex-jsonp

ActiveLibrary

kbrabrand/silex-jsonp
=====================

Content type aware JSON response handler for Silex

1.0.1(11y ago)1327MITPHPPHP &gt;=5.3.0

Since Jan 6Pushed 11y ago2 watchersCompare

[ Source](https://github.com/kbrabrand/silex-jsonp)[ Packagist](https://packagist.org/packages/kbrabrand/silex-jsonp)[ RSS](/packages/kbrabrand-silex-jsonp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

JSONP provider for Silex
========================

[](#jsonp-provider-for-silex)

Content type aware JSON response handler for Silex

[![Build Status](https://camo.githubusercontent.com/0c7d73404fe5abb03f21137d73778c44b6d9569fa75f4fb5b9a623fbf48cdf3c/68747470733a2f2f7472617669732d63692e6f72672f6b6272616272616e642f73696c65782d6a736f6e702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/kbrabrand/silex-jsonp)

Installation
------------

[](#installation)

Add `"kbrabrand/silex-jsonp": "XXX"` to the composer.json file inside your project and do a `composer install`. Check [Composer](http://packagist.org/packages/kbrabrand/silex-jsonp) for the latest available version.

Setup instructions
------------------

[](#setup-instructions)

Register the JSONP service provider in your Silex app like this;

```
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
-----

[](#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.

Tests
-----

[](#tests)

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

License
-------

[](#license)

License Copyright (c) 2015, Kristoffer Brabrand

Licensed under the MIT License

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

4139d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.4.0

1.0.1PHP &gt;=5.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4dc712d46ad616603b6d7c1be04809a6789935c6cf7c99e9f1e891ac2045f7a5?d=identicon)[kbrabrand](/maintainers/kbrabrand)

---

Top Contributors

[![kbrabrand](https://avatars.githubusercontent.com/u/2884292?v=4)](https://github.com/kbrabrand "kbrabrand (20 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kbrabrand-silex-jsonp/health.svg)

```
[![Health](https://phpackages.com/badges/kbrabrand-silex-jsonp/health.svg)](https://phpackages.com/packages/kbrabrand-silex-jsonp)
```

###  Alternatives

[stikmanw/silex-newrelic

Integrate the NewRelic PHP API into Silex framework

2014.7k](/packages/stikmanw-silex-newrelic)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
