SilverStripe CSP headers

CSPBackendTrait

Trait CSPBackendTrait contains all variables, static and dynamic, and their respective getters and setters This is to keep the CSPBackend class itself more readable

Table of Contents

Properties

$cssBuilder  : CSSBuilder
$cssSRI  : bool
CSS defaults to false.
$headCSS  : array<string|int, mixed>
CSS to be inserted in to the head
$headJS  : array<string|int, mixed>
JS to be inserted in to the head
$jsBuilder  : JSBuilder
$jsSRI  : bool
$useNonce  : bool

Methods

getCssBuilder()  : CSSBuilder
getHeadCSS()  : array<string|int, mixed>
getHeadJS()  : array<string|int, mixed>
getJsBuilder()  : JSBuilder
isCssSRI()  : bool
isJsSRI()  : bool
isUsesNonce()  : bool
setCssBuilder()  : void
setCssSRI()  : void
setHeadCSS()  : void
setHeadJS()  : void
setJsBuilder()  : void
setJsSRI()  : void
setUsesNonce()  : void

Properties

$cssSRI

CSS defaults to false.

protected static bool $cssSRI

It's causing a lot of trouble with CDN's usually

$headCSS

CSS to be inserted in to the head

protected static array<string|int, mixed> $headCSS = []

$headJS

JS to be inserted in to the head

protected static array<string|int, mixed> $headJS = []

Methods

getHeadCSS()

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

getHeadJS()

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

isUsesNonce()

public static isUsesNonce() : bool
Return values
bool

setCssSRI()

public static setCssSRI(bool $cssSRI) : void
Parameters
$cssSRI : bool

setHeadCSS()

public static setHeadCSS(array<string|int, mixed> $headCSS) : void
Parameters
$headCSS : array<string|int, mixed>

setHeadJS()

public static setHeadJS(array<string|int, mixed> $headJS) : void
Parameters
$headJS : array<string|int, mixed>

setJsSRI()

public static setJsSRI(bool $jsSRI) : void
Parameters
$jsSRI : bool

setUsesNonce()

public static setUsesNonce(bool $useNonce) : void
Parameters
$useNonce : bool

static::isUseNonce()


        
On this page

Search results