PHP code example of eveltic / cookie-bundle

1. Go to this page and download the library: Download eveltic/cookie-bundle 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/ */

    

eveltic / cookie-bundle example snippets


$consent = $cookieConsentService->getConsent();

if ($consent) {
    // Process the consent data
} else {
    // Handle the case where no consent has been given
}

if ($cookieConsentService->hasConsented()) {
    // User has already consented
} else {
    // Show consent banner or take appropriate action
}

if ($cookieConsentService->isCategoryAccepted('analytics')) {
    // Load analytics scripts or perform actions that 
bash
php bin/console ev:cookie:install
bash
php bin/console make:migration
php bin/console doctrine:migrations:migrate
command
php bin/console ev:cookie:install
command
php bin/console ev:cookie:archive
php bin/console ev:cookie:archive --date=2023-01-01 --output-format=csv
php bin/console ev:cookie:archive --date=2023-01-01 --dry-run