2017 © Pedro Peláez
 

symfony-bundle privacy-cookie-bundle

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

image

ezsystems/privacy-cookie-bundle

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  • Thursday, June 28, 2018
  • by bdunogier
  • Repository
  • 22 Watchers
  • 1 Stars
  • 16,556 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 10 Forks
  • 1 Open issues
  • 10 Versions
  • 6 % Grown

The README.md

Privacy Cookie Bundle

SensioLabsInsight, (*1)

This bundle adds privacy cookie banner into Symfony applications., (*2)

screenshot, (*3)

Requirements

  • Symfony v2.6 or later (including Symfony 3.x)

Installation

This package is available via Composer, so the instructions below are similar to how you install any other open source Symfony Bundle., (*4)

Run the following command in a terminal, from your Symfony installation root (pick most recent release):, (*5)

php composer.phar require ezsystems/privacy-cookie-bundle

Enable the bundle in app/AppKernel.php file:, (*6)

$bundles = array(
    // existing bundles
    new EzSystems\PrivacyCookieBundle\EzSystemsPrivacyCookieBundle(),
);

Add external assets to your bundle:, (*7)

  • CSS:
bundles/ezsystemsprivacycookie/css/privacycookie.css
  • JS:
bundles/ezsystemsprivacycookie/js/privacycookie.js

Assetic (Optional)

Enable the Assetic bundle in app/AppKernel.php file:, (*8)

$bundles = array( // ... // starting from Symfony 2.8 you have to enable AsseticBundle manually if you haven't done it before new Symfony\Bundle\AsseticBundle\AsseticBundle() );, (*9)

Add the following minimal configuration in config.yml file to enable Assetic support in your application (Symfony 2.8 and later):, (*10)

assetic:
    debug: '%kernel.debug%'
    use_controller: '%kernel.debug%'
    filters:
        cssrewrite: ~

If you are installing the bundle via composer require you must also copy assets to your project's web directory. You can do this by calling Symfony's built-in command from the project root directory:, (*11)

For Symfony 2.x:, (*12)

php app/console assets:install --symlink

For Symfony 3.x:, (*13)

php bin/console assets:install --symlink

In production environment you have to dump assets using Assetic built-in command:, (*14)

For Symfony 2.x:, (*15)

php app/console assetic:dump -e=prod

For Symfony 3.x:, (*16)

php bin/console assetic:dump -e=prod

Usage

Insert the following {{ show_privacy_cookie_banner(%privacy_policy_url%) }} helper somewhere in your footer template before the body ending tag. Replace the %privacy_policy_url% parameter with your policy page address., (*17)

Note that the %privacy_policy_url% parameter is not required, in this case no policy link will be shown., (*18)

The following optional parameters can be set as a second argument in an array format:, (*19)

Parameter Default value Description
cookieName privacyCookieAccepted Sets your own status cookie name
cookieValidity 365 Says how many days privacy banner should be hidden when user accepts policy?
cookiePath null Specifies the cookie path (by default cookie will be available only for the current domain)
caption Cookies help us create a good experience (...) Sets your own banner message caption
learnMoreText Learn More Sets title and text of privacy link
extraParams Extra Params Send extra params in your override template

Example of usage in standard Symfony application:, (*20)

{{ show_privacy_cookie_banner('http://ez.no/Privacy-policy') }}

or, (*21)

{{ show_privacy_cookie_banner('http://ez.no/Privacy-policy', {
   cookieName: 'myCookie',
   cookieValidity: 7,
   cookiePath: '/',
   caption: 'Nice to see you here',
   learnMoreText: 'Find out more'
}) }}

If you are using eZ Publish / Platform you can use ez_urlalias to generate path for specified content object:, (*22)

{{ show_privacy_cookie_banner(path('ez_urlalias', {contentId: 94}), {
   cookieName: 'myCookie',
   cookieValidity: 7,
   caption: 'Nice to see you here'
}) }}

Example of usage extraParams:, (*23)

{{ show_privacy_cookie_banner('http://ez.no/Privacy-policy', {
   cookieName: 'myCookie',
   extraParams: {
       my_param1: value_my_param1 ,
       my_param2: value_my_param2
   }
}) }}

The Versions

28/06 2018

dev-master

9999999-dev

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  Sources   Download

GPL-2.0

The Requires

 

twig symfony cookies ezpublish ezplatform policy privacy

21/07 2017

v1.0.0-beta7

1.0.0.0-beta7

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  Sources   Download

GPL-2.0

The Requires

 

twig symfony cookies ezpublish ezplatform policy privacy

11/08 2016

v1.0.0-beta6

1.0.0.0-beta6

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  Sources   Download

GPL-2.0

The Requires

 

twig symfony cookies ezpublish ezplatform policy privacy

26/07 2016

v1.0.0-beta5

1.0.0.0-beta5

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  Sources   Download

GPL-2.0

The Requires

 

twig symfony cookies ezpublish ezplatform policy privacy

03/06 2016

v1.0.0-beta4

1.0.0.0-beta4

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  Sources   Download

GPL-2.0

The Requires

 

symfony cookies ezpublish ezplatform policy privacy

24/03 2016

v1.0.0-beta3

1.0.0.0-beta3

Privacy cookie banner integration bundle into regular Symfony 2.x application (supports eZ Publish/eZ Platform)

  Sources   Download

GPL-2.0

The Requires

 

symfony cookies ezpublish ezplatform policy privacy

17/11 2015

v1.0.0-beta2

1.0.0.0-beta2

Privacy cookie banner integration bundle into eZ Publish/eZ Platform

  Sources   Download

GPL-2.0

The Requires

 

cookies policy privacy

28/08 2015

v1.0.0-beta1

1.0.0.0-beta1

Privacy cookie banner integration bundle into eZ Publish/eZ Platform

  Sources   Download

GPL-2.0

The Requires

 

cookies policy privacy

20/05 2015

v0.2

0.2.0.0

Privacy cookie banner integration bundle into eZ Publish/eZ Platform

  Sources   Download

GPL-2.0

The Requires

 

cookies policy privacy

08/04 2015

v0.1

0.1.0.0

Privacy cookie banner integration bundle into eZ Publish/eZ Platform

  Sources   Download

GPL-2.0

The Requires

 

cookies policy privacy