Broarm\CookieConsent\CookieConsent
Class CookieConsent
Synopsis
class CookieConsent
{
- // constants
- const COOKIE_NAME = 'CookieConsent';
- const NECESSARY = 'Necessary';
- const ANALYTICS = 'Analytics';
- const MARKETING = 'Marketing';
- const PREFERENCES = 'Preferences';
- // members
- private static array $required_groups = ;
- private static array $cookies = ;
- private static boolean $include_javascript = true;
- private static boolean $include_css = true;
- private static boolean $create_default_pages = true;
- private static boolean $xhr_mode = false;
- // methods
- public static bool check()
- public static void grant()
- public static void grantAll()
- public static void remove()
- public static array getConsent()
- public static void setConsent()
- public static bool isRequired()
Hierarchy
Uses
- SilverStripe\Core\Extensible
- SilverStripe\Core\Injector\Injectable
- SilverStripe\Core\Config\Configurable
Constants
Name | Value |
---|---|
COOKIE_NAME | 'CookieConsent' |
NECESSARY | 'Necessary' |
ANALYTICS | 'Analytics' |
MARKETING | 'Marketing' |
PREFERENCES | 'Preferences' |
Members
private
- $create_default_pages
- $include_css
- $include_javascript
- $required_groups
- $xhr_mode
Methods
public
- check() — Check if there is consent for the given cookie
- getConsent() — Get the current configured consent
- grant() — Grant consent for the given cookie group
- grantAll() — Grant consent for all the configured cookie groups
- isRequired() — Check if the group is required
- remove() — Remove consent for the given cookie group
- setConsent() — Save the consent