ajaz / cookie-consent-php
A simple PHP cookie consent widget that helps to EU Cookie Law
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ajaz/cookie-consent-php
This package is auto-updated.
Last update: 2025-10-15 02:21:17 UTC
README
PHP Cookie Consent Widget
Installation Guide
composer require ajaz/cookie-consent-php
How to use (Below PHP code should be apply in Head section)
use Ajaz\CookieConsent\Widget; require 'vendor/autoload.php'; <?php echo Widget::run([ 'websiteName'=>'Your website name', 'noticeBannerType'=> Widget::INTERSTITIAL_NOTICE_BANNER, 'consentType'=> Widget::EXPRESS, 'palette'=> Widget::DARK_SKIN, 'cookiesPolicyUrl'=> 'http://www.example.com/cookie-policy', ]); ?>
Configuration Options
| option | description | default | type | 
|---|---|---|---|
| websiteName | Your website name | Required | STRING | 
| noticeBannerType | Define the cookie consent popup style Options Widget::INTERSTITIAL_NOTICE_BANNER, Widget::SIMPLE_NOTICE_BANNER, Widget::HEADLINE_NOTICE_BANNER, Widget::STANDALONE_NOTICE_BANNER | Widget::INTERSTITIAL_NOTICE_BANNER | STRING | 
| consentType | Defines the cookie consent popup text style | Widget::EXPRESS | STRING | 
| palette | Cookie consent popup theme style by default dark skin for light skin Widget::LIGHT_SKIN | Widget::DARK_SKIN | STRING | 
| language | Cookie consent popup default language pass language code example en,fr | Widget::LANG_EN | STRING | 
| cookiesPolicyUrl | Your website cookie policy page url | Required | STRING | 
Worth knowing
Widgets throws an InvalidArgumentException if you define an invalid property in Widget::run() method
