Bitrix API

Cors extends Base

FinalYes

Class Cors Set headers for CORS.

Table of Contents

Methods

__construct()  : mixed
Constructor.
bindAction()  : mixed
className()  : string
Returns the fully qualified name of this class.
getAction()  : Action
getErrorByCode()  : Error
Getting once error with the necessary code.
getErrors()  : array<string|int, Error>
Getting array of errors.
listAllowedScopes()  : array<string|int, mixed>
List allowed values of scopes where the filter should work.
onAfterAction()  : void
onBeforeAction()  : void
setAllowedHeaders()  : self
setAllowedMethods()  : self

Methods

__construct()

Constructor.

public __construct([string|null $origin = null ][, bool $credentials = false ]) : mixed
Parameters
$origin : string|null = null

Origin. NULL - take from Origin header, '*' or like 'https://example.com'.

$credentials : bool = false

Set header Access-Control-Allow-Credentials.

bindAction()

public final bindAction(Action $action) : mixed
Parameters
$action : Action

className()

Returns the fully qualified name of this class.

public final static className() : string
Return values
string

getErrorByCode()

Getting once error with the necessary code.

public final getErrorByCode(string $code) : Error
Parameters
$code : string

Code of error.

Return values
Error

getErrors()

Getting array of errors.

public final getErrors() : array<string|int, Error>
Return values
array<string|int, Error>

listAllowedScopes()

List allowed values of scopes where the filter should work.

public listAllowedScopes() : array<string|int, mixed>
Return values
array<string|int, mixed>

onAfterAction()

public onAfterAction(Event $event) : void
Parameters
$event : Event

onBeforeAction()

public onBeforeAction(Event $event) : void
Parameters
$event : Event

setAllowedHeaders()

public setAllowedHeaders(array<string|int, mixed> $headers) : self
Parameters
$headers : array<string|int, mixed>
Return values
self

setAllowedMethods()

public setAllowedMethods(array<string|int, mixed> $methods) : self
Parameters
$methods : array<string|int, mixed>
Return values
self

        
On this page

Search results