https://github.com/hiqdev/yii2-cookie-consent
Yii2 Cookie Consent
https://github.com/hiqdev/yii2-cookie-consent
hacktoberfest
Last synced: 12 months ago
JSON representation
Yii2 Cookie Consent
- Host: GitHub
- URL: https://github.com/hiqdev/yii2-cookie-consent
- Owner: hiqdev
- License: bsd-3-clause
- Created: 2017-10-05T09:48:34.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-09T15:22:28.000Z (almost 5 years ago)
- Last Synced: 2024-10-13T14:15:37.873Z (over 1 year ago)
- Topics: hacktoberfest
- Language: PHP
- Size: 19.5 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yii2 Cookie Consent
[](https://packagist.org/packages/hiqdev/yii2-cookie-consent)
[](https://packagist.org/packages/hiqdev/yii2-cookie-consent)
[](https://travis-ci.org/hiqdev/yii2-cookie-consent)
[](https://scrutinizer-ci.com/g/hiqdev/yii2-cookie-consent/)
[](https://scrutinizer-ci.com/g/hiqdev/yii2-cookie-consent/)
Provides really easy alerting users about the use of
cookies on your site.
Cookie consent is required to comply with the [EU Cookie Law].
Additionally it detects if cookie is disabled in user's browser
and redirects user to predefined page.
Works by adding Behavior to the Application View.
Behavior listens to [EVENT_END_BODY] and echos the consent script.
[EVENT_END_BODY]: http://www.yiiframework.com/doc-2.0/yii-web-view.html#EVENT_END_BODY-detail
[EU Cookie Law]: http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm
## Installation
The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/).
Either run
```sh
php composer.phar require "hiqdev/yii2-cookie-consent"
```
or add
```json
"hiqdev/yii2-cookie-consent": "*"
```
to the require section of your composer.json.
## Configuration
This extension is supposed to be used with [composer-config-plugin].
Else look [src/config/web.php] for cofiguration example.
Available configuration parameters:
- `cookieConsent.disabled`
- `cookieConsent.params`
- `message` - message to be shown
- `dismiss`
- `theme`
- `more`
- `moreLink`
- `failUrl` - url user will be redirected when cookies are disabled
For more details please see [src/config/params.php].
[composer-config-plugin]: https://github.com/hiqdev/composer-config-plugin
[src/config/web.php]: src/config/web.php
[src/config/params.php]: src/config/params.php
## License
This project is released under the terms of the BSD-3-Clause [license](LICENSE).
Read more [here](http://choosealicense.com/licenses/bsd-3-clause).
Copyright © 2017, HiQDev (http://hiqdev.com/)
## Acknowledgements
- https://github.com/insites/cookieconsent
- https://github.com/cinghie/yii2-cookie-consent