LeKoala\CookieConsent\CookieConsent
Add cookie consent to your website
Synopsis
class CookieConsent
{
- // constants
- const COOKIE_CONSENT_LEVEL = 'cookie_consent_level';
- const COOKIE_CONSENT_ACCEPTED = 'cookie_consent_user_accepted';
- // methods
- public static void requirements()
- public static string getLanguage()
- public static array getAvailableLanguages()
- public static void clearRequirements()
- public static bool isAllowed()
- public static void setCookie()
- public static void clearStatus()
- public static void forceAllow()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
COOKIE_CONSENT_LEVEL | 'cookie_consent_level' |
COOKIE_CONSENT_ACCEPTED | 'cookie_consent_user_accepted' |
Members
private
- $opts — string
- $use_cdn — string
Methods
public
- clearRequirements() — Clear requirements, useful if you don't want any popup on a specific page after init
- clearStatus()
- forceAllow()
- getAvailableLanguages()
- getLanguage() — Get a valid language based on current locale
- isAllowed()
- requirements() — Add requirements
- setCookie() — Helper method to set cookies if accepted