Download the PHP package phpeek/xsolve-cookie-acknowledgement-bundle without Composer

On this page you can find all versions of the php package phpeek/xsolve-cookie-acknowledgement-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xsolve-cookie-acknowledgement-bundle

About

knpbundles.com

SensioLabsInsight

This bundle provides information about an cookies usage, which is forced by European Union by so-called EU cookie law.

It includes:

This bundle requires Multibyte String extension.

Example usage

Installation

1) Add to composer.json

"require": {
    "xsolve-pl/xsolve-cookie-acknowledgement-bundle": "1.0.*"
},

2) Install dependencies

composer install

3) Run the bundle in app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Xsolve\CookieAcknowledgementBundle\XsolveCookieAcknowledgementBundle(),
    );
}

Usage

For all static pages

By default the cookie bar will be visible on every page after turning on bundle.

For iframes

Disable response injection in app/config/config.yml

xsolve_cookie_acknowledgement:
    response_injection: false

Include cookie bar in appropriate location

{% include 'XsolveCookieAcknowledgementBundle::cookie_acknowledgement_bar.html.twig' %}

Configuration options

Configuration can be adjusted in app/config/config.yml

xsolve_cookie_acknowledgement:
    response_injection: true # default true
    template: custom_cookie_bar.html.twig # twig template name, default: XsolveCookieAcknowledgementBundle::cookie_acknowledgement_bar.html.twig

Altering cookie bar texts

Place tranlations file in your app directory:

app/Resources/translations/XsolveCookieAcknowledgementBundle.en.yml

And change texts

cookie.message: My message
cookie.message.accept: Accept button text

Of course you can set up those texts in as many locales as you want.

Altering cookie bar apperance

By default cookie bar comes with some default styles. If you wish to change those, use CSS. For example you may want pink background with placement on top of the page:

#cookie-law-info-bar {
    background: pink !important;
    top: 50px !important;
    bottom: auto !important;
}

Please note that every style needs to override provided inline styles.

Altering whole cookie bar template

You use your own template by setting it in the configuration (app/config/config.yml):

xsolve_cookie_acknowledgement:
    template: ::custom_cookie_bar.html.twig

In above case template is located in app/Resources/custom_cookie_bar.html.twig

Also base template can be reused be Twig extension (two blocks are used: xsolve_cookie_message and xsolve_cookie_message_js), see example below:

{% extends "XsolveCookieAcknowledgementBundle::cookie_acknowledgement_bar.html.twig" %}

{% block xsolve_cookie_message %}
    {{ parent() }}
    <div>This is something custom</div>
{% endblock %}

{% block xsolve_cookie_message_js %}
    {{ parent() }}
    <script type="text/javascript">
        document.getElementById('js-cookie-law-close-button').onclick = function () {
            alert('Got ya!');
        }
    </script>
{% endblock %}

Automated testing

There are fe simple test to make sure that everything works fine. To run tests include this bundle into some Symfony2 project (Symfony Standard Edition is enough). Then put testsuite in app/phpunit.xml

<testsuite name="XSolve Cookie Acknowledgement Bundle Suite">
    <directory>../vendor/xsolve-pl/xsolve-cookie-acknowledgement-bundle/Xsolve/CookieAcknowledgementBundle/Tests/</directory>
</testsuite>

And run

phpunit -c app/

All versions of xsolve-cookie-acknowledgement-bundle with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpeek/xsolve-cookie-acknowledgement-bundle contains the following files

Loading the files please wait ....