2017 © Pedro Peláez
 

symfony-bundle cookie-bundle

This bundle provides Cookie Statement layer

image

gfilipiak/cookie-bundle

This bundle provides Cookie Statement layer

  • Saturday, February 1, 2014
  • by gfilipiak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 37 Installations
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ConWeb.pl Cookie Bundle

This bundle provides a simple cookie statement layer with customizable template., (*1)

Installation

Installing this bundle can be done through these simple steps:, (*2)

  1. Add the bundle to your project as a composer dependency:
// composer.json
{
    // ...
    require: {
        // ...
        "gfilipiak/cookie-bundle": "dev-master"
    }
}
  1. Update your composer installation:
composer update
````

3. Add the bundle to your application kernel:
```php
// application/ApplicationKernel.php
public function registerBundles()
{
    // ...
    $bundle = array(
        // ...
        new ConWeb\Bundle\CookieBundle\CookieBundle(),
    );
    // ...

    return $bundles;
}
  1. Add routing import to your routing.yml
cookie:
    resource: "@CookieBundle/Resources/config/routing.xml"
    prefix:   /

Customization

You can change the default statement template by placing configuration parameters in your config.yml file:, (*3)

cookie:
        template: AcmeBundle:Cookie:statement.html.twig

Template should have fallowing structure:, (*4)

{% if not accepted %}
    {% stylesheets '@CookieBundle/Resources/public/less/style.less' %}
    <link rel="stylesheet" href="{{ asset_url }}">
    {% endstylesheets %}

    <section class="cookie">
        Your statement here.

     <section class="agree-button">
                <button id="cookieAgree" class="btn-success btn-small" data-ajax-url="{{ path('cookie_accept') }}">
                    Akceptuję
                </button>
            </section>
        </section>
        {% javascripts '@CookieBundle/Resources/public/js/script.js' %}
        <script type="text/javascript" src="{{ asset_url }}"></script>
        {% endjavascripts %}
    {% endif %}

TODO: - customize only the stamement text not the whole template - customize less path, (*5)

The Versions

01/02 2014

dev-master

9999999-dev http://github.com/gfilipiak/CookieBundle

This bundle provides Cookie Statement layer

  Sources   Download

MIT

The Requires

 

by Gabriel Filipiak

cookie layer statement