Added the method 'is' to request.php

This commit is contained in:
Pedro Borges 2011-06-18 11:54:59 -03:00
parent 150fa6a3ac
commit d446ccc82f
1 changed files with 18 additions and 0 deletions

View File

@ -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.
*