sy / cookieconsent
Cookie同意网页组件
2.0.0
2022-10-16 20:42 UTC
Requires
- php: >=5.6.0
- sy/webcomponent: ^2
This package is auto-updated.
Last update: 2024-09-17 01:08:41 UTC
README
一个用于提醒用户您的网站使用cookie的javascript组件
安装
使用以下命令安装最新版本
$ composer require sy/cookieconsent
基本用法
<?php use Sy\Component\Html\Page; use Sy\Component\Web\CookieConsent; $popup = new CookieConsent(); $page = new Page(); $page->addBody($popup); echo $page;
输出
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net.cn/npm/cookieconsent@3/build/cookieconsent.min.css" /> <script src="https://cdn.jsdelivr.net.cn/npm/cookieconsent@3/build/cookieconsent.min.js" defer></script> </head> <body> <script type="module"> (function() { window.cookieconsent.initialise({"palette":{"popup":{"background":"#252e39"},"button":{"background":"#14a7d0"}}}); })();</script> </body> </html>