定制 nickdekruijk/cookie-consent 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nickdekruijk/cookie-consent

Composer 安装命令:

composer require nickdekruijk/cookie-consent

包简介

A simple cookie accept popup for EU laws

README 文档

README

According to EU laws visitors should opt-in for all non essential cookies. This package adds a simple 'Accept Cookies' popup to your Laravel Application.

Installation

To install package use

composer require nickdekruijk/cookie-consent

Publish the config file in case you want to customize it

php artisan vendor:publish --provider=NickDeKruijk\\CookieConsent\\CookieConsentServiceProvider

Frontend

Add this to every view/page where you want to show the popup

@include('cookieconsent::show')

And wrap any code that places tracking cookies/pixels/code with the cookieConsentAccepted() helper, for example like this:

@if (cookieConsentAccepted())
// Your tracking code here
@endif

And style the popup as you like, for example:

.cookieconsent-container {position:fixed;bottom:0;left:0;right:0;background-color:red;text-align:center;padding:50px;z-index:9999;color:#fff}
.cookieconsent-close {position:absolute;top:0;right:0;color:red;font-size:50px;padding:10px;line-height:.7;font-weight:bold;display:block}
.cookieconsent-button {display:inline-block;padding:10px 20px;border:2px solid #fff;border-radius:5px;text-decoration:none;color:inherit;margin:10px}
.cookieconsent-button:hover {background-color:rgba(255,255,255,0.5)}
.cookieconsent-button-accept {background-color:#fff;color:red}
.cookieconsent-button-accept:hover {background-color:rgba(255,255,255,0.8)}

Changing text/localization

To change te tekst/buttons/info link copy the files from https://github.com/nickdekruijk/cookie-consent/tree/master/src/translations to /resources/lang/vendor/cookieconsent/ file and edit where needed.

统计信息

  • 总下载量: 70
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-08-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固