jClassicRequest

Extends \jRequest

handle "classical" request it just gets parameters from the url query and the post content. And responses can be in many format : text, html, xml.

..

package

jelix

subpackage

core_request

Methods

__construct

__construct() 
inherited

_generateHeaders

_generateHeaders() 
inherited

analyse the http request and sets the params property

_initParams() 
inherited abstract

init the url* properties

_initUrlData() 
inherited

return the application domain name

getDomainName() : string
inherited
since 1.2.3

Response

string

getErrorResponse

getErrorResponse( $currentResponse) : \jResponse
inherited

Arguments

$currentResponse

Response

\jResponse

return the ip address of the user

getIP() : string
inherited

Response

string

the ip

retrieve module and action fills also $module and $action properties

getModuleAction() 
inherited

Gets the value of a request parameter. If not defined, gets its default value.

getParam(string $name, mixed $defaultValue = null, boolean $useDefaultIfEmpty = false) : mixed
inherited

Arguments

$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 ""

Response

mixed

the request parameter value

return the server port of the application

getPort( $forceHttps = null) : string
inherited
since 1.2.4

Arguments

$forceHttps

Response

string

the ":port" or empty string

return the protocol

getProtocol() : string
inherited
since 1.2

Response

string

http:// or https://

return the server URI of the application (protocol + server name + port)

getServerURI( $forceHttps = null) : string
inherited
since 1.2.4

Arguments

$forceHttps

Response

string

the serveur uri

header

header( $name) 
inherited

Arguments

$name

headers

headers() 
inherited

initialize the request : analyse of http request etc.

init() 
inherited

.

says if this is an ajax request

isAjax() : boolean
inherited
since 1.3a1

Response

boolean

true if it is an ajax request

isAllowedResponse

isAllowedResponse(\jResponse $response) : boolean
inherited

Arguments

$response

\jResponse

the response

Response

boolean

true if the given class is allowed for the current request

isHttps

isHttps() : boolean
inherited
todo

support Forwarded and X-Forwared-Proto headers

Response

boolean

true if the request is made with HTTPS

Says if the request method is POST

isPostMethod() : boolean
inherited
since 1.6.17

Response

boolean

parseMultipartBody

parseMultipartBody( $contentType,  $input) 
inherited static

Arguments

$contentType

$input

call it when you want to read the content of the body of a request when the method is not GET or POST

readHttpBody() : mixed
inherited
since 1.2

Response

mixed

array of parameters or a single string when the content-type is unknown

Properties

the request type code

type : string
inherited
var

Type(s)

string

the type of the default response

defaultResponseType : string
inherited
var

Type(s)

string

request parameters could set from $_GET, $_POST, or from data processing of $HTTP_RAW_POST_DATA

params : array
inherited
var

Type(s)

array

the name of the base class for an allowed response for the current request

authorizedResponseClass : string
inherited
var

the name of the base class for an allowed response for the current request

Type(s)

string

the path of the entry point in the url (basePath included) if the url is /foo/index.php/bar, its value is /foo/

urlScriptPath : string
inherited
var

Type(s)

string

the name of the entry point if the url is /foo/index.php/bar, its value is index.php

urlScriptName : string
inherited
var

Type(s)

string

the path to the entry point in the url if the url is /foo/index.php/bar, its value is /foo/index.php.

urlScript : string
inherited

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

var

Type(s)

string

the pathinfo part of the url if the url is /foo/index.php/bar, its value is /bar

urlPathInfo : string
inherited
var

Type(s)

string

the module name

module : string
inherited
var

Type(s)

string

the action name ("controller:method")

action : string
inherited
var

Type(s)

string

_headers

_headers : 
inherited

Type(s)