Slim icon indicating copy to clipboard operation
Slim copied to clipboard

Reroute or internal redirect?

Open botcheddevil opened this issue 12 years ago • 2 comments

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');

});

botcheddevil avatar Sep 05 '14 12:09 botcheddevil

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.

StJudeWasHere avatar Sep 09 '14 14:09 StJudeWasHere

Closing out as this should be posted on help forum.

silentworks avatar Sep 10 '14 09:09 silentworks