2017 © Pedro PelĂĄez
 

yii2-extension yii2-gdpr-cookie-consent

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

image

albertborsos/yii2-gdpr-cookie-consent

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  • Monday, June 4, 2018
  • by albertborsos
  • Repository
  • 5 Watchers
  • 4 Stars
  • 541 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 17 Versions
  • 1491 % Grown

The README.md

GDPR compatible Cookie Consent widget for Yii 2.0 Framework

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept., (*1)

Build Status, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Run, (*4)

composer require --prefer-dist albertborsos/yii2-gdpr-cookie-consent

Usage

add the component to your config file:, (*5)

<?php
return [
    // ...
    'components' => [
        // ...
        'cookieConsent' => [
            'class' => \albertborsos\cookieconsent\Component::class,
            'urlSettings' => ['/site/cookie-settings'],
            'urlPrivacyPolicy' => ['/site/privacy-policy'],
            'documents' => [
                ['name' => 'Privacy Policy', 'url' => ['/docs/privacy-policy.pdf']],
            ],
            'disabledCategories' => [
                \albertborsos\cookieconsent\helpers\CookieHelper::CATEGORY_BEHAVIOR,
            ],
        ],
        // ...
        'i18n' => [
            // ...
            'translations' => [
                'cookieconsent/*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@vendor/albertborsos/yii2-gdpr-cookie-consent/src/messages',
                ],
            ],
            // ...
        ],
    ],
    // ...
];

Register the widget in your layout. For example in a _cookieconsent.php partial view., (*6)

<?php
/** @var \albertborsos\cookieconsent\Component $component */
$component = Yii::$app->cookieConsent;
$component->registerWidget([
    'policyLink' => ['/default/cookie-settings'],
    'policyLinkText' => \yii\helpers\Html::tag('i', null, ['class' => 'fa fa-cog']) . ' BeĂĄllĂ­tĂĄsok',
    'pluginOptions' => [
        'expiryDays' => 365,
        'hasTransition' => false,
        'revokeBtn' => '

Cookie Policy
', ], ]);

Add the cookie settings form to any of your controller:, (*7)

<?php

namespace app\controllers;

class SiteController extends \yii\web\Controller
{
    public function actions()
    {
        return [
            'cookie-settings' => \albertborsos\cookieconsent\actions\CookieSettingsAction::class,
            'privacy-policy' => \albertborsos\cookieconsent\actions\PrivacyPolicyAction::class,
        ];
    }
}

Check your relevant widget is allowed by the user or not with the CookieConsent helper class in the following way:, (*8)

<?php

use \albertborsos\cookieconsent\helpers\CookieHelper;
use \albertborsos\cookieconsent\Component;

if(CookieHelper::isAllowedType(CookieHelper::TYPE_GOOGLE_ANALYTICS)){
    // register GA script
}

if(CookieHelper::isAllowedCategory(CookieHelper::CATEGORY_BEHAVIOR)){
    // register hotjar script
}

The Versions

04/06 2018

dev-master

9999999-dev

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

04/06 2018

1.0.3

1.0.3.0

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

01/06 2018

1.0.2

1.0.2.0

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

01/06 2018

1.0.1

1.0.1.0

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

25/05 2018

1.0.0

1.0.0.0

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

25/05 2018

1.0.0-beta2

1.0.0.0-beta2

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

24/05 2018

1.0.0-beta1

1.0.0.0-beta1

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

24/05 2018

0.1.0-beta10

0.1.0.0-beta10

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

24/05 2018

0.1.0-beta9

0.1.0.0-beta9

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

22/05 2018

0.1.0-beta8

0.1.0.0-beta8

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

18/05 2018

0.1.0-beta7

0.1.0.0-beta7

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

18/05 2018

0.1.0-beta6

0.1.0.0-beta6

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

14/05 2018

0.1.0-beta5

0.1.0.0-beta5

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

14/05 2018

0.1.0-beta4

0.1.0.0-beta4

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

14/05 2018

0.1.0-beta3

0.1.0.0-beta3

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

06/03 2018

0.1.0-beta2

0.1.0.0-beta2

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent

06/03 2018

0.1.0-beta1

0.1.0.0-beta1

GDPR compatible Cookie Consent widget allows the user to choose which kind of cookies they want to accept.

  Sources   Download

MIT

The Requires

 

The Development Requires

extension yii2 cookie cookie policy gdpr cookie consent