PHPackages                             hiqdev/yii2-cookie-consent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hiqdev/yii2-cookie-consent

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

hiqdev/yii2-cookie-consent
==========================

Yii2 Cookie Consent

52781PHP

Since Jul 9Pushed 4y ago3 watchersCompare

[ Source](https://github.com/hiqdev/yii2-cookie-consent)[ Packagist](https://packagist.org/packages/hiqdev/yii2-cookie-consent)[ RSS](/packages/hiqdev-yii2-cookie-consent/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Cookie Consent
===================

[](#yii2-cookie-consent)

[![Latest Stable Version](https://camo.githubusercontent.com/8a3fc568ea923f84055fc97cbbcdc2cde1f3cfe3d4219ba33fc803d12299741c/68747470733a2f2f706f7365722e707567782e6f72672f6869716465762f796969322d636f6f6b69652d636f6e73656e742f762f737461626c65)](https://packagist.org/packages/hiqdev/yii2-cookie-consent)[![Total Downloads](https://camo.githubusercontent.com/0c1e2b83e584e08fcbf97ef37d036e2f663c6157357507c3aaaf06d0ef16656c/68747470733a2f2f706f7365722e707567782e6f72672f6869716465762f796969322d636f6f6b69652d636f6e73656e742f646f776e6c6f616473)](https://packagist.org/packages/hiqdev/yii2-cookie-consent)[![Build Status](https://camo.githubusercontent.com/aa3cbafab66e71c412cd5949ed336cd4f2b0418bd26c7cd15a2aeebbcda9b6b4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6869716465762f796969322d636f6f6b69652d636f6e73656e742e737667)](https://travis-ci.org/hiqdev/yii2-cookie-consent)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/2ac24d7f917628e57db7b643a588424538cfc6c48e7160e61a6cbd4401201456/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6869716465762f796969322d636f6f6b69652d636f6e73656e742e737667)](https://scrutinizer-ci.com/g/hiqdev/yii2-cookie-consent/)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b7dd48b2489e46ad3a78bf1ea65bf40d72062440c949aaf28f0915ca5e632e75/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6869716465762f796969322d636f6f6b69652d636f6e73656e742e737667)](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](http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm).

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](http://www.yiiframework.com/doc-2.0/yii-web-view.html#EVENT_END_BODY-detail) and echos the consent script.

Installation
------------

[](#installation)

The preferred way to install this yii2-extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require "hiqdev/yii2-cookie-consent"
```

or add

```
"hiqdev/yii2-cookie-consent": "*"
```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

This extension is supposed to be used with [composer-config-plugin](https://github.com/hiqdev/composer-config-plugin).

Else look [src/config/web.php](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](src/config/params.php).

License
-------

[](#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 ()

Acknowledgements
----------------

[](#acknowledgements)

-
-

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/790fd24da129907d373559f60c6994f664f06e3f518502c03580cc9f3594615e?d=identicon)[hiqdev](/maintainers/hiqdev)

---

Top Contributors

[![tafid](https://avatars.githubusercontent.com/u/3338188?v=4)](https://github.com/tafid "tafid (9 commits)")[![hiqsol](https://avatars.githubusercontent.com/u/11820365?v=4)](https://github.com/hiqsol "hiqsol (2 commits)")[![bladeroot](https://avatars.githubusercontent.com/u/10207103?v=4)](https://github.com/bladeroot "bladeroot (1 commits)")[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/hiqdev-yii2-cookie-consent/health.svg)

```
[![Health](https://phpackages.com/badges/hiqdev-yii2-cookie-consent/health.svg)](https://phpackages.com/packages/hiqdev-yii2-cookie-consent)
```

###  Alternatives

[overtrue/pinyin

Chinese to pinyin translator.

4.5k6.5M72](/packages/overtrue-pinyin)[rexlabs/enum

Enumeration (enum) implementation for PHP

48482.2k2](/packages/rexlabs-enum)[vanderlee/php-stable-sort-functions

Class of stable sort methods. Equal values remain in the original order. Only different values are sorted.

33741.2k1](/packages/vanderlee-php-stable-sort-functions)[sensiolabs/typescript-bundle

TypeScript support for Symfony + AssetMapper

38102.1k1](/packages/sensiolabs-typescript-bundle)[filsh/yii2-flags

Flags widget for yii2 framework

1611.1k](/packages/filsh-yii2-flags)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
