Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/slicohp/didublab-cookielawbundle
A simple Symfony bundle to display a cookie law message.
https://github.com/slicohp/didublab-cookielawbundle
cookie-consent symfony symfony-bundle symfony4 symfony5
Last synced: about 1 month ago
JSON representation
A simple Symfony bundle to display a cookie law message.
- Host: GitHub
- URL: https://github.com/slicohp/didublab-cookielawbundle
- Owner: SlicoHP
- Created: 2020-06-05T20:04:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T22:19:48.000Z (over 4 years ago)
- Last Synced: 2024-09-30T17:23:07.028Z (about 2 months ago)
- Topics: cookie-consent, symfony, symfony-bundle, symfony4, symfony5
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Symfony Didublab/CookielawBundle
This is a simple Symfony bundle to display a cookie law message on your **Symfony 4** and **Symfony 5** projects with small setup.## Install the bundle:
Using composer```composer
composer require didublab/cookielaw
```## Render the cookie law:
In your twig, add the twig function where you want to load the cookie consent:```twig
{{ cookie_law() }}
```This is the minimum setup, but if you want more, you can configure a few options:
## Configure options:
Create a new config file in your config/packages/ directory, named for example: cookie_law.yaml
This are the available options with the default options:
```yaml
didublab_cookielaw:
cookie_name: cookie-notice-accepted #the cookie name
cookie_value: true #the cookie value
cookie_days: 10 #cookie expiration in days
cookie_readmore_route: false #the route where you want to redirect the users to the "read more" section
```## Translations
You can translate the text of the cookie law at your needs
- Create inside the translations directory a file called cookielaw.(language).xliff
- Inside add the following content below and change the "target" tag with your translations
```xliff
didublab_cookielaw_cookie_text
This website use cookies. By continuing to browse this website, you declare to accept the use of cookies.
didublab_cookielaw_cookie_accept
Accept
didublab_cookielaw_cookie_readmore
More info
```