nowo-tech / cookie-consent-bundle
Symfony bundle providing a GDPR cookie consent modal with category toggles and optional consent logging
Package info
github.com/nowo-tech/CookieConsentBundle
Type:symfony-bundle
pkg:composer/nowo-tech/cookie-consent-bundle
Requires
- php: >=8.1 <8.6
- doctrine/doctrine-bundle: ^2.10 || ^3.0
- doctrine/orm: ^2.15 || ^3.0
- symfony/form: ^6.0 || ^7.0 || ^8.0
- symfony/framework-bundle: ^6.0 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.0 || ^7.0 || ^8.0
- symfony/routing: ^6.0 || ^7.0 || ^8.0
- symfony/translation: ^6.0 || ^7.0 || ^8.0
- symfony/twig-bundle: ^6.0 || ^7.0 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^10.0
- rector/rector: ^2.0
- symfony/yaml: ^6.0 || ^7.0 || ^8.0
This package is auto-updated.
Last update: 2026-06-15 08:55:38 UTC
README
Symfony bundle that renders a GDPR cookie consent modal with category toggles, AJAX form submission, optional consent logging, and configurable Doctrine table prefix.
Frontend behavior is implemented in TypeScript and built with Vite (make assets → src/Resources/public/nowo-consent-modal.js).
Extracted and modernized from the podologiapriego.com implementation (FatalNetwork/ConnectHolland CookieConsentBundle fork).
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
Additional documentation
Quick start
composer require nowo-tech/cookie-consent-bundle
# config/packages/nowo_cookie_consent.yaml nowo_cookie_consent: table_prefix: 'app_' # optional; yields app_nowo_cookie_consent_log use_logger: true
{# templates/base.html.twig #} {% if not nowo_cookie_consent_is_saved() %} {{ render(path('nowo_cookie_consent.show_if_not_set')) }} {% endif %}
Install public assets:
php bin/console assets:install
Demo
make -C demo up-symfony8 # Bootstrap demo: http://localhost:8014 make -C demo up-symfony8-tailwind # Tailwind demo: http://localhost:8015
demo/symfony8/— FrankenPHP Symfony 8 app with Bootstrap 5demo/symfony8-tailwind/— same demo with Tailwind CSS andui_theme: tailwind
See Demo with FrankenPHP for development vs. production worker mode.
Tests and coverage
| Language | Lines (approx.) | Command |
|---|---|---|
| PHP | ~100% | make test-coverage |
| TypeScript | ~96% | make test-ts |
make test
make test-coverage
make test-ts
make assets
make release-check
PHP coverage target is ~100% (currently ~100%; see Release); exclusions must be justified in phpunit.xml.dist.
Found this useful?
If this bundle helps your project, consider starring the repository on GitHub or installing from Packagist.