bueckl / silverstripe-cookie-warning
为Silverstripe项目提供Cookie警告。
dev-master
2016-03-22 11:02 UTC
This package is auto-updated.
Last update: 2024-09-23 07:48:16 UTC
README
在Silverstripe项目中显示Cookie警告
需求
- SilverStripe 3.1.*
安装
Composer
composer require "bueckl/silverstripe-cookie-warning": "*"
手动
- 下载并将模块复制到SilverStripe根目录: https://github.com/bueckl/cookie-warning/
使用方法
- 添加到Page.php文件
public static function CookieWarningShown() { $shown = Cookie::get("CookieWarningShown"); if(!$shown) { Cookie::set("CookieWarningShown", true); return false; } return true; }
- 链接css存档
'cookie-warning/css/CookieWarning.css'
- 添加到模板
<% include CookieWarning %>