Added ability to pass multiple items to Input::has_old.
This commit is contained in:
parent
65dca24939
commit
52390c4a63
|
@ -45,14 +45,21 @@ public static function get($key = null, $default = null)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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…
Reference in New Issue