Download the PHP package eveltic/cookie-bundle without Composer

On this page you can find all versions of the php package eveltic/cookie-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cookie-bundle

Eveltic Cookie Bundle

The Eveltic Cookie Consent Bundle is a Symfony package to implement and manage user cookie consents on websites, thus complying fully with the newest 2024 AEPD regulations. It provides an easy-to-use interface to configure, collect, and store the preferences of user consent.

Different types of cookie settings can be configured for technical, analytical, preference, and advertisement cookies. It features easy-to-use templates, multilingual support, and is easy to implement in Symfony applications to ensure that your website is within the bounds of the law.

All operations are managed through ajax requests without the need of any refresh.

Images

Banner

image

Configure cookies

image

Retract from consent

Floating button

image

Retract button and consent details

image image

Features

Installation

  1. Require the Bundle via Composer: This command will download and install this bundle inside your composer folder.

  2. Run install command This command will create the necesary files in order to be able to adequate to your configuration needs.

  3. Update the database If you force update the database:

or if you are using migrations:

  1. Add the functions to your template (View Usage section) `

    Uninstall

    Since there is no flex recipe, when uninstalling this bundle you need to manually remove the config files that were installed with the installation command. If you uninstall the bundle and doesn't remove those files the app will throw and exception telling you about this problem.

Configuration

If you ran the installation command all configuration files were in their corresponding folder. If you dont ran the command and you want to configure these are the files you need:

config/packages/eveltic_cookie.yaml

Available Configuration Options

config/routes/eveltic_cookie.yaml

Usage

Functions

Twig Functions

{{ ev_cookie_render() }}

Renders the cookie consent banner. This function generates the HTML content for displaying the cookie consent dialog based on the user's current preferences. This function should be included in a layout or template where you want the cookie consent banner to appear.

{{ ev_cookie_is_category_accepted('analytics') }}

{{ ev_cookie_is_category_accepted(['technical', 'analytics'])) }}

Checks if a specific cookie category (e.g., "technical", "analytics") is accepted by the user. This function is useful for conditionally loading scripts or other assets based on the user's consent for specific categories. This function support both string and array inputs. If you provide an array input both conditions must be true to return true.

{{ ev_cookie_show_cookie_banner() }}

Determines if the cookie consent banner should be shown to the user. This typically checks if the user has already provided consent. This function allows you to control whether the consent banner should be displayed, avoiding unnecessary re-rendering.

{{ ev_cookie_include_js() }}

Includes the JavaScript necessary for handling cookie consent interactions on the frontend. Place this in your template to ensure the necessary JavaScript is included for managing cookie consent.

{{ ev_cookie_include_css() }}

Includes the CSS styles for the cookie consent banner. This function is used to add the styling needed for the cookie consent banner.

{{ ev_cookie_include_assets() }}

Includes both the JavaScript and CSS assets required for the cookie consent banner in one go. This function is a convenience method to include both the JavaScript and CSS with a single function call, making it easier to integrate into your templates.

Usage Example

Backend Functions Provided by CookieConsentService

$cookieConsentService->getConsent()

Retrieves the current cookie consent data from the user's session or cookies.

$cookieConsentService->hasConsented()

Checks whether the user has already provided consent for cookies. This function can be used to determine whether to display the cookie consent banner.

$cookieConsentService->isCategoryAccepted(string $category)

Determines if a specific cookie category has been accepted by the user.

Commands

Installs the necessary assets and settings for the cookie consent management.

Archives old cookie consent data to keep your database clean.

Parameters

Translations

This bundle supports multiple languages for the consent banner. Available translations include:

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any features, bug fixes, or improvements.

License

This bundle is released under the MIT License. See the LICENSE file for more details. Feel free to use in any condition and modify all as you want.


All versions of cookie-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
symfony/framework-bundle Version ^6.0 | ^7.0
symfony/orm-pack Version ^2.3
twig/twig Version ^3.0
symfony/yaml Version ^6.0 | ^7.0
symfony/asset Version ^6.0 | ^7.0
symfony/console Version ^6.0 | ^7.0
symfony/http-foundation Version ^6.0 | ^7.0
symfony/http-kernel Version ^6.0 | ^7.0
symfony/dependency-injection Version ^6.0 | ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package eveltic/cookie-bundle contains the following files

Loading the files please wait ...