PHP Class Jelix\Routing\ClientRequest

.)
Afficher le fichier Open project: jelix/jelix Class Usage Examples

Méthodes publiques

Свойство Type Description
$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 Properties

Свойство Type Description
$urlMapper Jelix\Routing\UrlMapping\UrlActionMapper

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
_initParams ( ) analyse the http request and sets the params property
_initUrlData ( ) init the url* properties

Private Methods

Méthode Description
_generateHeaders ( )

Method Details

__construct() public méthode

public __construct ( )

_initParams() abstract protected méthode

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

_initUrlData() protected méthode

init the url* properties
protected _initUrlData ( )

getDomainName() public méthode

return the application domain name
Since: 1.2.3
public getDomainName ( ) : string
Résultat string

getErrorResponse() public méthode

public getErrorResponse ( $currentResponse ) : Jelix\Routing\ServerResponse
Résultat Jelix\Routing\ServerResponse

getIP() public méthode

return the ip address of the user
public getIP ( ) : string
Résultat string the ip

getModuleAction() public méthode

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

getParam() public méthode

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 ""
Résultat mixed the request parameter value

getPort() public méthode

return the server port of the application
Since: 1.2.4
public getPort ( $forceHttps = null ) : string
Résultat string the ":port" or empty string

getProtocol() public méthode

return the protocol
Since: 1.2
public getProtocol ( ) : string
Résultat string http:// or https://

getResponse() public méthode

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
Résultat Jelix\Routing\ServerResponse the response object

getServerURI() public méthode

return the server URI of the application (protocol + server name + port)
Since: 1.2.4
public getServerURI ( $forceHttps = null ) : string
Résultat string the serveur uri

header() public méthode

public header ( $name )

headers() public méthode

public headers ( )

init() public méthode

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

isAjax() public méthode

says if this is an ajax request
Since: 1.3a1
public isAjax ( ) : boolean
Résultat boolean true if it is an ajax request

isAllowedResponse() public méthode

public isAllowedResponse ( Jelix\Routing\ServerResponse $response ) : boolean
$response Jelix\Routing\ServerResponse the response
Résultat boolean true if the given class is allowed for the current request

readHttpBody() public méthode

call it when you want to read the content of the body of a request when the method is not GET or POST
Since: 1.2
public readHttpBody ( ) : mixed
Résultat mixed array of parameters or a single string when the content-type is unknown

Property Details

$action public_oe property

the action name ("controller:method")
public string $action
Résultat string

$authorizedResponseClass public_oe property

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

$defaultResponseType public_oe property

the type of the default response
public string $defaultResponseType
Résultat string

$module public_oe property

the module name
public string $module
Résultat string

$params public_oe property

request parameters could set from $_GET, $_POST, or from php://input data
public array $params
Résultat array

$type public_oe property

the request type code
public string $type
Résultat string

$urlMapper protected_oe property

protected UrlActionMapper,Jelix\Routing\UrlMapping $urlMapper
Résultat Jelix\Routing\UrlMapping\UrlActionMapper

$urlPathInfo public_oe property

the pathinfo part of the url if the url is /foo/index.php/bar, its value is /bar
public string $urlPathInfo
Résultat string

$urlScript public_oe property

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
Résultat string

$urlScriptName public_oe property

the name of the entry point if the url is /foo/index.php/bar, its value is index.php
public string $urlScriptName
Résultat string

$urlScriptPath public_oe property

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
Résultat string