diff --git a/src/Klein/Request.php b/src/Klein/Request.php index 6696f5d9..fae8fced 100644 --- a/src/Klein/Request.php +++ b/src/Klein/Request.php @@ -88,7 +88,10 @@ class Request */ protected $body; - + /** + * Request uri Environment for Dynamic Routing + */ + protected $uri = "REQUEST_URI"; /** * Methods */ @@ -392,7 +395,18 @@ public function userAgent() { return $this->headers->get('USER_AGENT'); } - + + /** + * Set the request URI + * + * @return string + */ + public function seturi($uri) + { + $this->uri = $uri ; + return $this; + } + /** * Gets the request URI * @@ -400,7 +414,7 @@ public function userAgent() */ public function uri() { - return $this->server->get('REQUEST_URI', '/'); + return $this->server->get($this->uri, '/'); } /**