MvlabsEventLogger is a ZF2 module that allow to log user events in easy way based on event listener.
- PHP version 5.5.0 or higher
-
Add to your
composer.json
:$ php composer.phar require mvlabs/mvlabs-eventlogger
-
Now tell composer to download MvlabsEventLogger by running the command:
$ php composer.phar update mvlabs/mvlabs-eventlogger
-
Enabling it in your
application.config.php
file.<?php return [ 'modules' => [ // ... 'MvlabsEventLogger', ], // ... ];
The module registers an EventManager:
$eventManager = $serviceLocator->get('MvlabsEventLogger\EventManager\EventManager');
//register event
$this->eventManager->trigger('user.logging', $this, [
'platform' => 'mvlabs',
'area' => 'users',
'action' => 'user loggin',
]);