Syntro\SilverstripeKlaro\KlaroRequirements_Backend
This backend extends the original with necessary functionality for adding klaro based service requirement. At the core, we want to provide the same flow of adding requirements as if we were adding scripts normally.
If you have a custom implementation of this backend, make sure you extend
from this class to ensure correct service handling
- Author: Matthias Leutenegger <hello@syntro.ch>
Synopsis
class KlaroRequirements_Backend
extends Requirements_Backend
{
- // members
- protected array $klaroJavascript = ;
- protected array $customKlaroScript = ;
- protected array $klaroCss = ;
- // methods
- public void klaroJavascript()
- public void clear()
- public void restore()
- public void customKlaroScript()
- public void klaroCss()
- public array getKlaroJavascript()
- public array getcustomKlaroScript()
- public array getKlaroCss()
- public string includeInHTML()
Hierarchy
Extends
- SilverStripe\View\Requirements_Backend
Members
protected
- $customKlaroScript
—
array
All custom javascript code that is inserted into the page's HTML and handled by klaro - $klaroCss
—
array
All css files that are inserted into the page's HTML and handled by klaro - $klaroJavascript
—
array
contains the script ressources which should be handled by klaro
Methods
public
- clear() — Clear either a single or all requirements
- customKlaroScript() — Register the given JavaScript code into the list of requirements
- getKlaroCss() — Returns an array of required CSS file
- getKlaroJavascript() — Returns an array of required JavaScript, excluding blocked and duplicates of provided files.
- getcustomKlaroScript() — Returns an array of required JavaScript
- includeInHTML() — Update the given HTML and add the klaro managed scripts
- klaroCss() — Register the given stylesheet into the list of requirements.
- klaroJavascript() — klaroJavascript - add a klaro managed script to the stack.
- restore() — Restore requirements cleared by call to Requirements::clear