We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I have something like that
public function testAccept() { $this->object->always('Accept', array('application/json' => function($data) { return 'ha'; })); $request = new Request('get', '/users/alganet'); $_SERVER['HTTP_ACCEPT'] = 'application/json'; $this->object->get('/users/*', function() { return range(0, 10); })->accept(array('application/json' => function ($d) { var_dump($d); })); $r = $this->object->dispatchRequest($request)->response(); $this->assertEquals(json_encode(range(0, 10)), $r); }
The always accept is execute before the accept of the route. In my opinion, olny the route accept shloud be run, not both.
The text was updated successfully, but these errors were encountered:
Some routines should indeed be unique inside each route. I believe you're right and I'm gonna work on this.
Sorry, something went wrong.
This has been fixed, but instead of keeping the first unique routine, the last one is always used. Most important: they don't run twice.
Awesome!
On Thu, Nov 3, 2011 at 6:11 PM, Alexandre Gomes Gaigalas < reply@reply.github.com>wrote:
This has been fixed, but instead of keeping the first unique routine, the last one is always used. Most important: they don't run twice. Reply to this email directly or view it on GitHub: #9 (comment)
Reply to this email directly or view it on GitHub: #9 (comment)
thiagorigo.com | @thiagophx | ZCE 5.3
No branches or pull requests
If I have something like that
public function testAccept()
{
$this->object->always('Accept', array('application/json' => function($data) {
return 'ha';
}));
$request = new Request('get', '/users/alganet');
$_SERVER['HTTP_ACCEPT'] = 'application/json';
$this->object->get('/users/*', function() {
return range(0, 10);
})->accept(array('application/json' => function ($d)
{
var_dump($d);
}));
$r = $this->object->dispatchRequest($request)->response();
$this->assertEquals(json_encode(range(0, 10)), $r);
}
The always accept is execute before the accept of the route.
In my opinion, olny the route accept shloud be run, not both.
The text was updated successfully, but these errors were encountered: