承接 kbrabrand/silex-jsonp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kbrabrand/silex-jsonp

最新稳定版本:1.0.1

Composer 安装命令:

composer require kbrabrand/silex-jsonp

包简介

Content type aware JSON response handler for Silex

README 文档

README

Content type aware JSON response handler for Silex

Build Status

Installation

Add "kbrabrand/silex-jsonp": "XXX" to the composer.json file inside your project and do a composer install. Check Composer for the latest available version.

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

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

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 Copyright (c) 2015, Kristoffer Brabrand kristoffer@brabrand.no

Licensed under the MIT License

统计信息

  • 总下载量: 327
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-06