mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
Added ability to pass multiple items to Input::has_old.
This commit is contained in:
parent
65dca24939
commit
52390c4a63
@ -45,14 +45,21 @@ class Input {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the old input data contains an item.
|
* Determine if the old input data contains an item or set of items.
|
||||||
*
|
*
|
||||||
* @param string $key
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function has_old($key)
|
public static function has_old()
|
||||||
{
|
{
|
||||||
return ( ! is_null(static::old($key)));
|
foreach (func_get_args() as $key)
|
||||||
|
{
|
||||||
|
if (is_null($value = static::old($key)) or trim((string) $value) == '')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user