Requests

Sodapop gives developers the choice of using PHP's builtin $_REQUEST array or its own Sodapop_Request object, which provides several convenient methods that makes dealing with requests.

Within a controller, the Sodapop_Request object can be accessed through $this->request.

Public Methods

__get($key) (mixed)
Returns the named property from the request. This includes properties pulled from the URL.
asArray() (array)
Returns the request values as an associative array.
exists($key) (boolean)
Returns true if the key is in the request.
getFile($name) (array)
Returns the file array if there was a file upload with this name, and null otherwise.
getFileContents($name) (array)
Returns the file contents if there was a file upload with this name, and null otherwise.
getHeader($name) (string)
Returns the specified header from the request, and null if it doesn't exist.
getMethod() (string)
Returns the name of the method in lowercase.
isGet() (boolean)
Returns true if the request is an HTTP GET.
isPost() (boolean)
Returns true if the request is an HTTP POST.
moveFile($value, $location) (void)
Moves the specified uploaded file from the temporary directory to a new location. The second parameter should be a complete file path.