snapshotpl/zf-config-listener

There is no license information available for the latest version (1.1.0) of this package.

1.1.0 2021-06-14 13:49 UTC

README

Attach any Laminas Event Manager listener using configuration

Usage

If you want to attach my-listener and module-listener to my-service service with event manager, you need to configure listener:

<?php

return [
    'service_manager' => [
        'factories' => [
            'my-service' => MyServiceFactory::class,
            'my-listener' => MyListenerFactory::class,
            'module-listener' => ModuleListenerFactory::class,
        ],
    ],
    'listeners_config' => [
        'my-service' => [
            'my-listener',
            'module-listener',
        ],
    ],
];

Installation

composer require snapshotpl/zf-config-listener

add add ZfConfigListener module to application's configuration.