Open nickell opened 9 years ago
It's simple with non anonymous functions:
// Routes
$this->respond('POST', '/?', array($listings, 'main'));
$this->respond('POST', '/[:id]/listings', array($users, 'listings'));
And in $listings->main()
which handles first route, you call return $users->listings($request, $response);
, which handles the second route.
Hey, I am loving this router, thanks for making my life easier! I have a quick question about redirecting routes.
Say I have one route:
And here's the route I'd like to redirect to:
Due to the nature of redirecting (sending a new Location header), when that redirect is fired, that second route would match if it were accepting the
GET
method. I'm looking for a way to redirect (or "reroute") without making another round trip so that I don't lose the original POST vars. Any ideas?