Syntro\SilverstripeKlaro\KlaroRequirements
Requirements tracker for klaro services. This class is intended to be similar to the {@see Requirements} class from Silverstripe.
In order to make this work in a simple way, we use an extended backend, which
allows us to make use of the same pattern and functionality of the original
{@see Requirements_Backend}.
In order to be consistent, we define everything using the original backend
and rely on the injector pattern to actually switch to our implementation
- Author: Matthias Leutenegger <hello@syntro.ch>
Synopsis
class KlaroRequirements
{
- // members
- private static Requirements_Backend $backend = NULL;
- // methods
- public static Requirements_Backend backend()
- public static void klaroJavascript()
- public static void customKlaroScript()
- public static void klaroCss()
Members
private
- $backend
—
SilverStripe\View\Requirements_Backend
Instance of the requirements for storage. You can create your own backend to change the default JS and CSS inclusion behaviour.
Methods
public
- backend()
- customKlaroScript() — Register the given JavaScript code into the list of requirements
- klaroCss() — klaroCss - add a klaro managed script to the stack.
- klaroJavascript() — klaroJavascript - add a klaro managed script to the stack.