mirror of
https://github.com/werkraum-media/abtest.git
synced 2024-12-22 13:26:09 +01:00
Daniel Siepmann
9f0e6cd6c5
* Adds new fields to pages. * Adds new event handler and integration to add necessary JS to track experiment with variant.
34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DanielSiepmann\Configuration;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
|
use WerkraumMedia\ABTest\Events\SwitchedToVariant;
|
|
use WerkraumMedia\ABTest\Hook\TypoScriptFrontendController;
|
|
use WerkraumMedia\ABTest\MatomoTracker;
|
|
use WerkraumMedia\ABTest\Middleware\SetCookie;
|
|
use WerkraumMedia\ABTest\TCA\VariantFilter;
|
|
|
|
return static function (ContainerConfigurator $containerConfigurator) {
|
|
$services = $containerConfigurator
|
|
->services()
|
|
->defaults()
|
|
->autowire()
|
|
->autoconfigure()
|
|
;
|
|
|
|
$services->load('WerkraumMedia\\ABTest\\', '../Classes/');
|
|
|
|
$services->set(TypoScriptFrontendController::class)->public();
|
|
$services->set(VariantFilter::class)->public();
|
|
$services->set(SetCookie::class)->tag('event.listener', [
|
|
'method' => 'handleVariant',
|
|
'event' => SwitchedToVariant::class,
|
|
]);
|
|
$services->set(MatomoTracker::class)->tag('event.listener', [
|
|
'method' => 'handleVariant',
|
|
'event' => SwitchedToVariant::class,
|
|
]);
|
|
};
|