ajaz/cookie-consent-php

A simple PHP cookie consent widget that helps to EU Cookie Law

v1.0 2020-11-14 11:05 UTC

This package is auto-updated.

Last update: 2024-09-15 00:04:15 UTC


README

PHP Cookie Consent Widget

Installation Guide

composer require ajaz/cookie-consent-php

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

Worth knowing

Widgets throws an InvalidArgumentException if you define an invalid property in Widget::run() method