Свойство | Тип | Описание | |
---|---|---|---|
$base | string | Base URL path. | |
$data | array | Inputs prefixed with 'data' will have the data prefix removed. If there is overlap between an input prefixed with data and one without, the 'data' prefixed value will take precedence. | |
$here | string | The full address to the current request | |
$params | array | Array of parameters parsed from the URL. | |
$query | array | Array of querystring arguments | |
$url | string | The URL string used for the request. | |
$webroot | string | webroot path segment for the request. |
Свойство | Тип | Описание | |
---|---|---|---|
$_detectors | array | There are several ways to specify a detector, see CakeRequest::addDetector() for the various formats and ways to define detectors. | |
$_input | string | Copy of php://input. Since this stream can only be read once in most SAPI's keep a copy of it so users don't need to know about that detail. |
Метод | Описание | |
---|---|---|
__call ( string $name, array $params ) : mixed | Missing method handler, handles wrapping older style isAjax() type methods | |
__construct ( string $url = null, boolean $parseEnvironment = true ) | Constructor | |
__get ( string $name ) : mixed | Magic get method allows access to parsed routing parameters directly on the object. | |
__isset ( string $name ) : boolean | Magic isset method allows isset/empty checks on routing parameters. | |
acceptLanguage ( string $language = null ) : mixed | Get the languages accepted by the client, or check if a specific language is accepted. | |
accepts ( string $type = null ) : mixed | Find out which content types the client accepts or check if they accept a particular type of content. | |
addDetector ( string $name, array $options ) : void | Add a new detector to the list of detectors that a request can use. | |
addParams ( array $params ) : self | Add parameters to the request's parsed parameter set. This will overwrite any existing parameters. | |
addPaths ( array $paths ) : self | Add paths to the requests' paths vars. This will overwrite any existing paths. | |
allowMethod ( string | array $methods ) : boolean | Allow only certain HTTP request methods. If the request method does not match a 405 error will be shown and the required "Allow" response header will be set. | |
clientIp ( boolean $safe = true ) : string | Get the IP the client is using, or says they are using. | |
contentType ( ) : string | Get the content type used in this request. | |
data ( string $name ) : mixed | self | Provides a read/write accessor for $this->data. Allows you to use a syntax similar to CakeSession for reading post data. | |
domain ( integer $tldLength = 1 ) : string | Get the domain name and include $tldLength segments of the tld. | |
header ( string $name ) : mixed | Read an HTTP header from the Request information. | |
here ( boolean $base = true ) : string | Get the value of the current requests URL. Will include named parameters and querystring arguments. | |
host ( boolean $trustProxy = false ) : string | Get the host that the request was handled on. | |
input ( string $callback = null ) : The | Read data from php://input. Useful when interacting with XML or JSON request body content. | |
is ( string | array $type ) : boolean | Check whether or not a Request is a certain type. | |
isAll ( array $types ) : boolean | Check that a request matches all the given types. | |
method ( ) : string | Get the HTTP method used for this request. | |
normalizedHere ( ) : string | 現在のURLを正規化して取得する | |
offsetExists ( string $name ) : boolean | Array access isset() implementation | |
offsetGet ( string $name ) : mixed | Array access read implementation | |
offsetSet ( string $name, mixed $value ) : void | Array access write implementation | |
offsetUnset ( string $name ) : void | Array access unset() implementation | |
onlyAllow ( string | array $methods ) : boolean | Alias of CakeRequest::allowMethod() for backwards compatibility. | |
param ( string $name ) : mixed | Safely access the values in $this->params. | |
parseAccept ( ) : array | Parse the HTTP_ACCEPT header and return a sorted array with content types as the keys, and pref values as the values. | |
query ( string $name ) : mixed | Provides a read accessor for $this->query. Allows you to use a syntax similar to CakeSession for reading URL query data. | |
referer ( boolean $local = false ) : string | Returns the referer that referred this request. | |
setInput ( string $input ) : void | Modify data originally from php://input. Useful for altering json/xml data in middleware or DispatcherFilters before it gets to RequestHandlerComponent | |
subdomains ( integer $tldLength = 1 ) : array | Get the subdomains for a host. |
Метод | Описание | |
---|---|---|
_acceptHeaderDetector ( array $detect ) : boolean | Detects if a specific accept header is present. | |
_base ( ) : string | Returns a base URL and sets the proper webroot | |
_environmentDetector ( array $detect ) : boolean | Detects if a specific environment variable is present. | |
_extensionDetector ( array $detect ) : boolean | Detects if a URL extension is present. | |
_headerDetector ( array $detect ) : boolean | Detects if a specific header is present. | |
_paramDetector ( array $detect ) : boolean | Detects if a specific request parameter is present. | |
_parseAcceptWithQualifier ( string $header ) : array | Parse Accept* headers with qualifier options. | |
_processFileData ( string $path, array $data, string $field ) : void | Recursively walks the FILES array restructuring the data into something sane and useable. | |
_processFiles ( ) : void | Process $_FILES and move things into the object. | |
_processGet ( ) : void | Process the GET parameters and move things into the object. | |
_processPost ( ) : void | process the post data and set what is there into the object. | |
_readInput ( ) : string | Read data from php://input, mocked in tests. | |
_url ( ) : string | Get the request uri. Looks in PATH_INFO first, as this is the exact value we need prepared by PHP. Following that, REQUEST_URI, PHP_SELF, HTTP_X_REWRITE_URL and argv are checked in that order. |
public __construct ( string $url = null, boolean $parseEnvironment = true ) | ||
$url | string | Trimmed URL string to use. Should not contain the application base path. |
$parseEnvironment | boolean | Set to false to not auto parse the environment. ie. GET, POST and FILES. |
protected _acceptHeaderDetector ( array $detect ) : boolean | ||
$detect | array | Detector options array. |
Результат | boolean | Whether or not the request is the type you are checking. |
protected _environmentDetector ( array $detect ) : boolean | ||
$detect | array | Detector options array. |
Результат | boolean | Whether or not the request is the type you are checking. |
protected _extensionDetector ( array $detect ) : boolean | ||
$detect | array | Detector options array. |
Результат | boolean | Whether or not the request is the type you are checking. |
protected _headerDetector ( array $detect ) : boolean | ||
$detect | array | Detector options array. |
Результат | boolean | Whether or not the request is the type you are checking. |
protected _paramDetector ( array $detect ) : boolean | ||
$detect | array | Detector options array. |
Результат | boolean | Whether or not the request is the type you are checking. |
protected static _parseAcceptWithQualifier ( string $header ) : array | ||
$header | string | Header to parse. |
Результат | array |
protected _processFiles ( ) : void | ||
Результат | void |
protected _processGet ( ) : void | ||
Результат | void |
protected _processPost ( ) : void | ||
Результат | void |
protected _readInput ( ) : string | ||
Результат | string | contents of php://input |
public static acceptLanguage ( string $language = null ) : mixed | ||
$language | string | The language to test. |
Результат | mixed | If a $language is provided, a boolean. Otherwise the array of accepted languages. |
public contentType ( ) : string | ||
Результат | string |
public input ( string $callback = null ) : The | ||
$callback | string | A decoding callback that will convert the string data to another representation. Leave empty to access the raw input data. You can also supply additional parameters for the decoding callback using var args, see above. |
Результат | The | decoded/processed request data. |
public normalizedHere ( ) : string | ||
Результат | string |
public offsetExists ( string $name ) : boolean | ||
$name | string | thing to check. |
Результат | boolean |
public offsetUnset ( string $name ) : void | ||
$name | string | Name to unset. |
Результат | void |
public parseAccept ( ) : array | ||
Результат | array | An array of prefValue => array(content/types) |
public subdomains ( integer $tldLength = 1 ) : array | ||
$tldLength | integer | Number of segments your tld contains. For example: `example.com` contains 1 tld. While `example.co.uk` contains 2. |
Результат | array | An array of subdomains. |
protected array $_detectors | ||
Результат | array |
protected string $_input | ||
Результат | string |
public array $data | ||
Результат | array |
public string $here | ||
Результат | string |
public array $params | ||
Результат | array |
public string $webroot | ||
Результат | string |