Skip to content

A javascript component for for alerting users about the use of cookies on your website

License

Notifications You must be signed in to change notification settings

syframework/cookieconsent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sy/cookieconsent

A javascript component for for alerting users about the use of cookies on your website

Installation

Install the latest version with

$ composer require sy/cookieconsent

Basic Usage

<?php

use Sy\Component\Html\Page;
use Sy\Component\Web\CookieConsent;

$popup = new CookieConsent();

$page = new Page();

$page->addBody($popup);

echo $page;

Output:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
<script src="https://cdn.jsdelivr.net/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>

About

A javascript component for for alerting users about the use of cookies on your website

Resources

License

Stars

Watchers

Forks

Packages

No packages published