PHP Класс Jelix\Routing\ClientRequest

.)
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$action string the action name ("controller:method")
$authorizedResponseClass the name of the base class for an allowed response for the current request
$defaultResponseType string the type of the default response
$module string the module name
$params array request parameters could set from $_GET, $_POST, or from php://input data
$type string the request type code
$urlPathInfo string the pathinfo part of the url if the url is /foo/index.php/bar, its value is /bar
$urlScript string Warning: if the app is behind a proxy, the path includes the backendBasePath, not the basePath. Use urlScriptPath and urlScriptName to have the "public" url, as needed for the frontend HTTP server
$urlScriptName string the name of the entry point if the url is /foo/index.php/bar, its value is index.php
$urlScriptPath string the path of the entry point in the url (basePath included) if the url is /foo/index.php/bar, its value is /foo/

Защищенные свойства (Protected)

Свойство Тип Описание
$urlMapper Jelix\Routing\UrlMapping\UrlActionMapper

Открытые методы

Метод Описание
__construct ( )
getDomainName ( ) : string return the application domain name
getErrorResponse ( $currentResponse ) : Jelix\Routing\ServerResponse
getIP ( ) : string return the ip address of the user
getModuleAction ( ) retrieve module and action fills also $module and $action properties
getParam ( string $name, mixed $defaultValue = null, boolean $useDefaultIfEmpty = false ) : mixed Gets the value of a request parameter. If not defined, gets its default value.
getPort ( $forceHttps = null ) : string return the server port of the application
getProtocol ( ) : string return the protocol
getResponse ( $type = '', boolean $useOriginal = false ) : Jelix\Routing\ServerResponse get a response object.
getServerURI ( $forceHttps = null ) : string return the server URI of the application (protocol + server name + port)
header ( $name )
headers ( )
init ( Jelix\Routing\UrlMapping\UrlActionMapper $urlMapper ) initialize the request : analyse of http request etc.
isAjax ( ) : boolean says if this is an ajax request
isAllowedResponse ( Jelix\Routing\ServerResponse $response ) : boolean
readHttpBody ( ) : mixed call it when you want to read the content of the body of a request when the method is not GET or POST

Защищенные методы

Метод Описание
_initParams ( ) analyse the http request and sets the params property
_initUrlData ( ) init the url* properties

Приватные методы

Метод Описание
_generateHeaders ( )

Описание методов

__construct() публичный Метод

public __construct ( )

_initParams() абстрактный защищенный Метод

analyse the http request and sets the params property
abstract protected _initParams ( )

_initUrlData() защищенный Метод

init the url* properties
protected _initUrlData ( )

getDomainName() публичный Метод

return the application domain name
С версии: 1.2.3
public getDomainName ( ) : string
Результат string

getErrorResponse() публичный Метод

public getErrorResponse ( $currentResponse ) : Jelix\Routing\ServerResponse
Результат Jelix\Routing\ServerResponse

getIP() публичный Метод

return the ip address of the user
public getIP ( ) : string
Результат string the ip

getModuleAction() публичный Метод

retrieve module and action fills also $module and $action properties
public getModuleAction ( )

getParam() публичный Метод

Gets the value of a request parameter. If not defined, gets its default value.
public getParam ( string $name, mixed $defaultValue = null, boolean $useDefaultIfEmpty = false ) : mixed
$name string the name of the request parameter
$defaultValue mixed the default returned value if the parameter doesn't exists
$useDefaultIfEmpty boolean true: says to return the default value if the parameter value is ""
Результат mixed the request parameter value

getPort() публичный Метод

return the server port of the application
С версии: 1.2.4
public getPort ( $forceHttps = null ) : string
Результат string the ":port" or empty string

getProtocol() публичный Метод

return the protocol
С версии: 1.2
public getProtocol ( ) : string
Результат string http:// or https://

getResponse() публичный Метод

get a response object.
public getResponse ( $type = '', boolean $useOriginal = false ) : Jelix\Routing\ServerResponse
$useOriginal boolean true:don't use the response object redefined by the application
Результат Jelix\Routing\ServerResponse the response object

getServerURI() публичный Метод

return the server URI of the application (protocol + server name + port)
С версии: 1.2.4
public getServerURI ( $forceHttps = null ) : string
Результат string the serveur uri

header() публичный Метод

public header ( $name )

headers() публичный Метод

public headers ( )

init() публичный Метод

.
public init ( Jelix\Routing\UrlMapping\UrlActionMapper $urlMapper )
$urlMapper Jelix\Routing\UrlMapping\UrlActionMapper

isAjax() публичный Метод

says if this is an ajax request
С версии: 1.3a1
public isAjax ( ) : boolean
Результат boolean true if it is an ajax request

isAllowedResponse() публичный Метод

public isAllowedResponse ( Jelix\Routing\ServerResponse $response ) : boolean
$response Jelix\Routing\ServerResponse the response
Результат boolean true if the given class is allowed for the current request

readHttpBody() публичный Метод

call it when you want to read the content of the body of a request when the method is not GET or POST
С версии: 1.2
public readHttpBody ( ) : mixed
Результат mixed array of parameters or a single string when the content-type is unknown

Описание свойств

$action публичное свойство

the action name ("controller:method")
public string $action
Результат string

$authorizedResponseClass публичное свойство

the name of the base class for an allowed response for the current request
public $authorizedResponseClass

$defaultResponseType публичное свойство

the type of the default response
public string $defaultResponseType
Результат string

$module публичное свойство

the module name
public string $module
Результат string

$params публичное свойство

request parameters could set from $_GET, $_POST, or from php://input data
public array $params
Результат array

$type публичное свойство

the request type code
public string $type
Результат string

$urlMapper защищенное свойство

protected UrlActionMapper,Jelix\Routing\UrlMapping $urlMapper
Результат Jelix\Routing\UrlMapping\UrlActionMapper

$urlPathInfo публичное свойство

the pathinfo part of the url if the url is /foo/index.php/bar, its value is /bar
public string $urlPathInfo
Результат string

$urlScript публичное свойство

Warning: if the app is behind a proxy, the path includes the backendBasePath, not the basePath. Use urlScriptPath and urlScriptName to have the "public" url, as needed for the frontend HTTP server
public string $urlScript
Результат string

$urlScriptName публичное свойство

the name of the entry point if the url is /foo/index.php/bar, its value is index.php
public string $urlScriptName
Результат string

$urlScriptPath публичное свойство

the path of the entry point in the url (basePath included) if the url is /foo/index.php/bar, its value is /foo/
public string $urlScriptPath
Результат string