PHP code example of estouai / cookie-consent

1. Go to this page and download the library: Download estouai/cookie-consent library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

estouai / cookie-consent example snippets


'consent_mode' => [
    'necessary' => ['security_storage'],
    'analytics' => ['analytics_storage'],
    'marketing' => ['ad_storage', 'ad_user_data', 'ad_personalization'],
]

'button' => [
    'enabled' => true,
    'label' => 'Cookies',
    'aria_label' => 'Cookie preferences',
    'position' => 'bottom-right', // bottom-left | bottom-right | top-left | top-right
    'background' => '#ffffff',
    'foreground' => '#6b7280',
    'border' => 'rgba(1, 57, 131, 0.12)',
    'shadow' => '0 8px 24px rgba(1, 57, 131, 0.16)',
    'icon' => 'cookie', // cookie | none | custom HTML/SVG string
    'icon_background' => '#013983',
    'icon_foreground' => '#ffffff',
],
text
config/cookie-consent.php