Commit 208eb8a3 by Taylor Otwell

move json method to input class.

parent 138d08c0
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
class Input { class Input {
/** /**
* The JSON payload for applications using Backbone.js or similar.
*
* @var object
*/
public static $json;
/**
* The key used to store old input in the session. * The key used to store old input in the session.
* *
* @var string * @var string
...@@ -93,6 +100,18 @@ class Input { ...@@ -93,6 +100,18 @@ class Input {
} }
/** /**
* Get the JSON payload for the request.
*
* @return object
*/
public static function json()
{
if ( ! is_null(static::$json)) return static::$json;
return static::$json = json_decode(Request::foundation()->getContent());
}
/**
* Get a subset of the items from the input data. * Get a subset of the items from the input data.
* *
* <code> * <code>
......
...@@ -10,13 +10,6 @@ class Request { ...@@ -10,13 +10,6 @@ class Request {
public static $route; public static $route;
/** /**
* The JSON payload for applications using Backbone.js or similar.
*
* @var object
*/
public static $json;
/**
* The Symfony HttpFoundation Request instance. * The Symfony HttpFoundation Request instance.
* *
* @var HttpFoundation\Request * @var HttpFoundation\Request
...@@ -80,18 +73,6 @@ class Request { ...@@ -80,18 +73,6 @@ class Request {
} }
/** /**
* Get the JSON payload for the request.
*
* @return object
*/
public static function json()
{
if ( ! is_null(static::$json)) return static::$json;
return static::$json = json_decode(static::foundation()->getContent());
}
/**
* Get an item from the $_SERVER array. * Get an item from the $_SERVER array.
* *
* @param string $key * @param string $key
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment