klein / klein.php

A fast & flexible router
MIT License
2.66k stars 290 forks source link

Update for Dynamic Request URI / Allow PATH_INFO Environment #346

Open amrikasir opened 7 years ago

amrikasir commented 7 years ago

if you want PATH_INFO for Request uri: I change Request.php a bit.

$klein = new \Klein\Klein;
$klein->respond('GET', '/hello', function () {
   return "Hello ";
});

#change REQUEST_URI to PATH_INFO
$requestClass = \Klein\Request::createFromGlobals();
$requestClass->seturi('PATH_INFO');

$klein->dispatch($requestClass);

sorry for my bad english