fix bugs in input class.
This commit is contained in:
@@ -55,6 +55,7 @@
|
|||||||
- Added `Request::set_env` method.
|
- Added `Request::set_env` method.
|
||||||
- `Schema::drop` now accepts `$connection` as second parameter.
|
- `Schema::drop` now accepts `$connection` as second parameter.
|
||||||
- Added `Input::merge` method.
|
- Added `Input::merge` method.
|
||||||
|
- Added `Input::replace` method.
|
||||||
|
|
||||||
<a name="upgrade-3.2"></a>
|
<a name="upgrade-3.2"></a>
|
||||||
## Upgrading From 3.1
|
## Upgrading From 3.1
|
||||||
|
|||||||
@@ -55,7 +55,14 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function get($key = null, $default = null)
|
public static function get($key = null, $default = null)
|
||||||
{
|
{
|
||||||
$value = array_get(Request::foundation()->request->all(), $key);
|
$input = Request::foundation()->request->all();
|
||||||
|
|
||||||
|
if (is_null($key))
|
||||||
|
{
|
||||||
|
return array_merge($input, static::query());
|
||||||
|
}
|
||||||
|
|
||||||
|
$value = array_get($input, $key);
|
||||||
|
|
||||||
if (is_null($value))
|
if (is_null($value))
|
||||||
{
|
{
|
||||||
@@ -82,6 +89,11 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function query($key = null, $default = null)
|
public static function query($key = null, $default = null)
|
||||||
{
|
{
|
||||||
|
if (is_null($key))
|
||||||
|
{
|
||||||
|
return Request::foundation()->query->all();
|
||||||
|
}
|
||||||
|
|
||||||
return array_get(Request::foundation()->query->all(), $key, $default);
|
return array_get(Request::foundation()->query->all(), $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,6 +163,11 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function old($key = null, $default = null)
|
public static function old($key = null, $default = null)
|
||||||
{
|
{
|
||||||
|
if (is_null($key))
|
||||||
|
{
|
||||||
|
return Session::get(Input::old_input, array());
|
||||||
|
}
|
||||||
|
|
||||||
return array_get(Session::get(Input::old_input, array()), $key, $default);
|
return array_get(Session::get(Input::old_input, array()), $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -168,6 +185,11 @@ class Input {
|
|||||||
*/
|
*/
|
||||||
public static function file($key = null, $default = null)
|
public static function file($key = null, $default = null)
|
||||||
{
|
{
|
||||||
|
if (is_null($key))
|
||||||
|
{
|
||||||
|
return $_FILES;
|
||||||
|
}
|
||||||
|
|
||||||
return array_get($_FILES, $key, $default);
|
return array_get($_FILES, $key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user