Silex FormatResponseProvider for ajax requests
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/FormatResponse/Silex/Provider
README.md

README.md

FormatResponseProvider

Register provider

use \Silex\Provider\FormatResponseProvider;

$app->register(new FormatResponseProvider());

Render

$app->get('/api.{format}', function($format) use ($app) {

    return $app['render']->format(array('status'=>'success'), $format);

})->assert('format', 'json|xml|debug');

Authors: