r::get PHP Method

get() static public method

Gets a request value by key
static public get ( mixed $key = false, mixed $default = null ) : mixed
$key mixed The key to look for. Pass false or null to return the entire request array.
$default mixed Optional default value, which should be returned if no element has been found
return mixed
    static function get($key = false, $default = null)
    {
        $request = self::method() == 'GET' ? self::data() : array_merge(self::data(), self::body());
        if (empty($key)) {
            return $request;
        }
        return a::get($request, $key, $default);
    }

Usage Example

示例#1
0
文件: kirby.php 项目: sdvig/kirbycms
/**
 * Shortcut for r::get()
 *
 * @param   mixed    $key The key to look for. Pass false or null to return the entire request array. 
 * @param   mixed    $default Optional default value, which should be returned if no element has been found
 * @return  mixed
 * @package Kirby
 */
function get($key = false, $default = null)
{
    return r::get($key, $default);
}
All Usage Examples Of r::get