From d446ccc82fe63481a08d0f4f5041f423db52e06d Mon Sep 17 00:00:00 2001 From: Pedro Borges Date: Sat, 18 Jun 2011 11:54:59 -0300 Subject: [PATCH] Added the method 'is' to request.php --- system/request.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/system/request.php b/system/request.php index e56e77e8..d8b69625 100644 --- a/system/request.php +++ b/system/request.php @@ -58,6 +58,24 @@ public static function uri() return ($uri == '') ? '/' : Str::lower($uri); } + /** + * Check the request URI. + * + * @param mixed $uri + * @return bool + */ + public static function is($uri) + { + if (is_array($uri)) + { + return (in_array(static::uri(), $uri)) ? true : false; + } + else + { + return (static::uri() == $uri) ? true : false; + } + } + /** * Get the request method. *