Bitrix API

Context

Context of current request.

Table of Contents

Methods

__construct()  : mixed
Creates new instance of context.
getApplication()  : Application
Returns backreference to Application.
getCulture()  : Culture|null
Returns culture of the context.
getCurrent()  : Context
Static method returns current instance of context.
getEnvironment()  : mixed
getLanguage()  : string|null
Returns current language ID (en, ru).
getLanguageObject()  : EO_Language|null
Returns current language object.
getRequest()  : Request|HttpRequest
Returns request object of the context.
getResponse()  : Response|HttpResponse
Returns response object of the context.
getServer()  : Server
Returns server object of the context.
getSite()  : string
Returns current site
getSiteObject()  : EO_Site|null
Returns current language object.
initialize()  : mixed
Initializes context by request and response objects.
setCulture()  : $this
Sets culture of the context.
setLanguage()  : $this
Sets language of the context.
setResponse()  : $this
Sets response of the context.
setSite()  : $this
Sets site of the context.

Methods

getCulture()

Returns culture of the context.

public getCulture() : Culture|null
Return values
Culture|null

getCurrent()

Static method returns current instance of context.

public static getCurrent() : Context
Tags
static
Return values
Context

getEnvironment()

public getEnvironment() : mixed

getLanguage()

Returns current language ID (en, ru).

public getLanguage() : string|null
Return values
string|null

getLanguageObject()

Returns current language object.

public getLanguageObject() : EO_Language|null
Return values
EO_Language|null

getServer()

Returns server object of the context.

public getServer() : Server
Return values
Server

getSite()

Returns current site

public getSite() : string
Return values
string

getSiteObject()

Returns current language object.

public getSiteObject() : EO_Site|null
Return values
EO_Site|null

initialize()

Initializes context by request and response objects.

public initialize(Request $request, Response $response, Server $server[, array<string|int, mixed> $params = [] ]) : mixed
Parameters
$request : Request
$response : Response
$server : Server
$params : array<string|int, mixed> = []

setCulture()

Sets culture of the context.

public setCulture(Culture $culture) : $this
Parameters
$culture : Culture
Return values
$this

setLanguage()

Sets language of the context.

public setLanguage(string|EO_Language $language) : $this
Parameters
$language : string|EO_Language
Return values
$this

setResponse()

Sets response of the context.

public setResponse(Response $response) : $this
Parameters
$response : Response

Response.

Return values
$this

setSite()

Sets site of the context.

public setSite(string|EO_Site $site) : $this
Parameters
$site : string|EO_Site
Return values
$this

        
On this page

Search results