tobiassjosten/responsible-service-provider 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

tobiassjosten/responsible-service-provider

最新稳定版本:1.0.0

Composer 安装命令:

composer require tobiassjosten/responsible-service-provider

包简介

A Silex ServiceProvider for automagic response formatting.

README 文档

README

A Silex ServiceProvider for automagic response formatting.

Build Status

Installation

  1. Add the package to you composer.json:

    $ composer require tobiassjosten/responsible-service-provider

(For Silex 1, add the 0.0.1 version to the end of that commend.)

  1. Register it in your application.

    $app->register(new \Tobiassjosten\Silex\ResponsibleServiceProvider());

Usage

Once enabled, just have your controllers return data as an array. ResponsibleServiceProvider will do the rest.

$app->get('/foo', function () { return ['Bar']; }); 

In JSON:

$ curl -I -H 'Accept: application/json' http://example.com/foo HTTP/1.1 200 OK Date: Tue, 07 May 2013 08:30:58 GMT Server: Apache/2.2.22 (Ubuntu) X-Powered-By: PHP/5.4.9-4ubuntu2 Cache-Control: no-cache Transfer-Encoding: chunked Content-Type: application/json ["Bar"] 

And in XML:

$ curl -I -H 'Accept: application/xml' http://example.com/foo HTTP/1.1 200 OK Date: Tue, 07 May 2013 08:30:58 GMT Server: Apache/2.2.22 (Ubuntu) X-Powered-By: PHP/5.4.9-4ubuntu2 Cache-Control: no-cache Transfer-Encoding: chunked Content-Type: application/xml <?xml version="1.0"?> <response><item key="0">Bar</item></response> 

统计信息

  • 总下载量: 90.23k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 34
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 34
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固