All Projects → tobiassjosten → ResponsibleServiceProvider

tobiassjosten / ResponsibleServiceProvider

Licence: MIT license
Silex service provider for seamless HTTP content negotiation

Programming Languages

PHP
23972 projects - #3 most used programming language

Labels

Projects that are alternatives of or similar to ResponsibleServiceProvider

Silex Kitchen Edition
This project is a sample or a bootstrap silex application
Stars: ✭ 645 (+1742.86%)
Mutual labels:  silex
Payumserver
Payment processing microservice. Written in Symfony4
Stars: ✭ 103 (+194.29%)
Mutual labels:  silex
silex-ddd-skeleton
A simple skeleton of silex application using ddd arquitecture
Stars: ✭ 19 (-45.71%)
Mutual labels:  silex
Cache Service Provider
A Cache Service Provider for Silex, using the doctrine/cache package
Stars: ✭ 23 (-34.29%)
Mutual labels:  silex
Superleansilexplate
Silex Superlean Starter
Stars: ✭ 61 (+74.29%)
Mutual labels:  silex
Silex Webprofiler
Stars: ✭ 207 (+491.43%)
Mutual labels:  silex
Bolt
Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.
Stars: ✭ 4,136 (+11717.14%)
Mutual labels:  silex
silex-starter-pack
A starter pack for beginning development with the Silex PHP framework. Includes a basic admin control panel, and user login system.
Stars: ✭ 12 (-65.71%)
Mutual labels:  silex
Crudlex
CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages
Stars: ✭ 102 (+191.43%)
Mutual labels:  silex
Slugify
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
Stars: ✭ 2,697 (+7605.71%)
Mutual labels:  silex
Silexstarter
Starter app based on Silex framework with mvc and modular arch, scaffold generator, and admin panel
Stars: ✭ 11 (-68.57%)
Mutual labels:  silex
Silex
something to help you spark
Stars: ✭ 61 (+74.29%)
Mutual labels:  silex
Transport
Swiss public transport API
Stars: ✭ 215 (+514.29%)
Mutual labels:  silex
Silex Skeleton
A skeleton to get started with Silex
Stars: ✭ 805 (+2200%)
Mutual labels:  silex
sm-groupcheck-web
GroupCheck web API.
Stars: ✭ 14 (-60%)
Mutual labels:  silex
Pinboard
Realtime PHP monitoring system which aggregates and displays Pinba data.
Stars: ✭ 479 (+1268.57%)
Mutual labels:  silex
Php Getting Started
Getting Started with PHP on Heroku
Stars: ✭ 170 (+385.71%)
Mutual labels:  silex
hello-world-app-php-silex
Hello World sample app in PHP and Silex
Stars: ✭ 23 (-34.29%)
Mutual labels:  silex
PHP-Frameworks-Bench
Popular PHP Frameworks Benchmark.
Stars: ✭ 28 (-20%)
Mutual labels:  silex
Pimple
A small PHP dependency injection container
Stars: ✭ 2,491 (+7017.14%)
Mutual labels:  silex

ResponsibleServiceProvider

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>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].