Slim
Slim copied to clipboard
Reroute or internal redirect?
Hi Can we reroute or do an internal redirect?
for example
$app->get('/downloadBill/:order_id', function ($order_id) {
// Mutate the header; can we do this as well??
$app->request->setHeader('Accept', 'image/jpeg');
//switch to a different route
$app->reroute('/api/politically_correct_rest_service');
});
A subRequest method has been added in the 3.0 version. For the 2.x branch you can try asking in the help forum instead, maybe someone can give advice on how to handle this.
Closing out as this should be posted on help forum.