Download the PHP package lexik/data-layer-bundle without Composer

On this page you can find all versions of the php package lexik/data-layer-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 data-layer-bundle

LexikDataLayerBundle

Latest Stable Version Build Status Scrutinizer Code Quality SensioLabsInsight

Manipulate the Google Tag Manager Data Layer from your Symfony application. This bundle is compatible Symfony 2.7+, 3.0+ and 4.0+ and PHP 5.4+ to 7.0+.

Installation

Add lexik/data-layer-bundle to your composer.json file:

composer require "lexik/data-layer-bundle"

Register the bundle in app/AppKernel.php:

Adding informations to the Data Layer

To pass informations to the Data Layer use the lexik_data_layer.manager.data_layer_manager service directly.

Event / Session Data

Use case

Notify an application event that could be used as goal or conversion like a user registration.

Usage

Get the service lexik_data_layer.manager.data_layer_manager and pass an associative array to it's add() method, it will be stored in session until it is passed to a page. Much like a Flash Message.

Using sessions as storage allows you to notify of an event even after a redirect for example.

Example usage from an EventListener to notify a user registration :

Default Data

Use case

Set the user id on every page for example.

Usage example

Create a service implementing the Lexik\Bundle\DataLayerBundle\Collector\CollectorInterface and tag it using the lexik_data_layer.collector tag.

It's handle method will be passed the current Data Layer array, which you can modify by adding or modifying its values.

Adding / Writing Data Layer variables to the page

Use the provided lexik_data_layer() twig function to write the Data Layer value to a page template. This will automatically reset the Data Layer informations stored in session.

Don't forget to use it BEFORE you insert the Tag Manager tag.

Testing

Setup the test suite using Composer:

$ composer install

Run it using PHPUnit:

$ vendor/bin/phpunit

Contributing

See CONTRIBUTING file.

Credits

License

This bundle is under the MIT license. See the complete license in the bundle:

Resources/meta/LICENSE

All versions of data-layer-bundle with dependencies

PHP Build Version
Package Version
Requires symfony/framework-bundle Version ~2.7|~3.0|~4.0
symfony/security-bundle Version ~2.7|~3.0|~4.0
twig/twig Version ~1.0|~2.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 lexik/data-layer-bundle contains the following files

Loading the files please wait ....