Permalink
Switch branches/tags
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (11 sloc) 370 Bytes
<?php
namespace Pff\ServiceProvider\AcceptHeaderServiceProvider;
use Silex\Route as SilexRoute;
class Route extends SilexRoute
{
public function accept($content_types)
{
$content_regexps = array_map(function($item) { return preg_quote($item, '/'); }, $content_types);
$this->setRequirement('_accept', implode('|', $content_regexps));
}
}