ajaz/

cookie-consent-php

一个简单的PHP Cookie Consent小部件,帮助遵守欧盟Cookie法规

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小部件

安装指南

composer require ajaz/cookie-consent-php

ajaz/cookie-consent-php

如何使用(以下PHP代码应在Head部分应用)

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',
]); ?>

配置选项

值得了解的

如果在小部件的run()方法中定义了无效属性,小部件会抛出InvalidArgumentException异常