Added ability to pass multiple parameters to Cookie::has.

This commit is contained in:
Taylor Otwell 2011-06-15 11:22:40 -07:00
parent 55eb2ecb08
commit 65dca24939
1 changed files with 11 additions and 4 deletions

View File

@ -83,14 +83,21 @@ public function send()
} }
/** /**
* Determine if a cookie exists. * Determine if a cookie or set of cookies exists.
* *
* @param string $name
* @return bool * @return bool
*/ */
public static function has($name) public static function has()
{ {
return ( ! is_null(static::get($name))); foreach (func_get_args() as $key)
{
if (is_null(static::get($key)))
{
return false;
}
}
return true;
} }
/** /**