gfilipiak / cookie-bundle
This bundle provides Cookie Statement layer
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.2
- symfony/symfony: >=2.3.0
This package is not auto-updated.
Last update: 2024-12-17 06:58:05 UTC
README
#ConWeb.pl Cookie Bundle
This bundle provides a simple cookie statement layer with customizable template.
Installation
Installing this bundle can be done through these simple steps:
- Add the bundle to your project as a composer dependency:
// composer.json { // ... require: { // ... "gfilipiak/cookie-bundle": "dev-master" } }
- Update your composer installation:
composer update
- Add the bundle to your application kernel:
// application/ApplicationKernel.php public function registerBundles() { // ... $bundle = array( // ... new ConWeb\Bundle\CookieBundle\CookieBundle(), ); // ... return $bundles; }
- 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:
cookie: template: AcmeBundle:Cookie:statement.html.twig
Template should have fallowing structure:
{% 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