Firesphere\CSPHeaders\View\CSPBackend
Synopsis
class CSPBackend
extends Requirements_Backend
{
- // constants
- const SHA256 = 'sha256';
- const SHA384 = 'sha384';
- // methods
- public void __construct()
- public void customScript()
- public void customCSS()
- public void insertHeadTags()
- public string|null getTagType()
- protected array getOptions()
- public void javascript()
- protected bool isAsync()
- protected bool isDefer()
- public string includeInHTML()
- protected bool shouldContinue()
- protected string getJSRequirements()
- protected array getCSSRequirements()
- protected string getHeadTags()
- protected string insertContent()
- // Inherited methods from CSPBackendTrait
- public static bool isJsSRI()
- public static void setJsSRI()
- public static bool isCssSRI()
- public static void setCssSRI()
- public static array getHeadCSS()
- public static void setHeadCSS()
- public static array getHeadJS()
- public static void setHeadJS()
- public static bool isUsesNonce()
- public static void setUsesNonce()
- public JSBuilder getJsBuilder()
- public void setJsBuilder()
- public CSSBuilder getCssBuilder()
- public void setCssBuilder()
Hierarchy
Extends
- SilverStripe\View\Requirements_Backend
Uses
- SilverStripe\Core\Config\Configurable
- Firesphere\CSPHeaders\Traits\CSPBackendTrait
Constants
Name | Value |
---|---|
SHA256 | 'sha256' |
SHA384 | 'sha384' |
Members
protected
- $cssBuilder — Firesphere\CSPHeaders\Builders\CSSBuilder
- $cssSRI
—
Firesphere\CSPHeaders\Traits\bool
CSS defaults to false. - $headCSS
—
array
CSS to be inserted in to the head - $headJS
—
array
JS to be inserted in to the head - $jsBuilder — Firesphere\CSPHeaders\Builders\JSBuilder
- $jsSRI — Firesphere\CSPHeaders\Traits\bool
- $useNonce — Firesphere\CSPHeaders\Traits\bool
Methods
protected
- getCSSRequirements()
- getHeadTags()
- getJSRequirements()
- getOptions()
- insertContent()
- isAsync()
- isDefer()
- shouldContinue()
public
- __construct()
- customCSS()
- customScript() — Specific method for JS insertion
- getTagType() — Determine the type of the head tag if it's js or css
- includeInHTML() — Copy-paste of the original backend code. There is no way to override this in a more clean way
- insertHeadTags() — Add the following custom HTML code to the `<head>` section of the page
- javascript() — Register the given JavaScript file as required.