-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathModule.php
53 lines (48 loc) · 1.55 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
namespace Laminas\I18n;
use Laminas\ModuleManager\ModuleManager;
use Laminas\ServiceManager\ServiceManager;
/**
* @psalm-import-type ServiceManagerConfiguration from ServiceManager
*/
class Module
{
/**
* Return laminas-i18n configuration for laminas-mvc application.
*
* @return array{
* filters: ServiceManagerConfiguration,
* service_manager: ServiceManagerConfiguration,
* validators: ServiceManagerConfiguration,
* view_helpers: ServiceManagerConfiguration,
* }
*/
public function getConfig()
{
$provider = new ConfigProvider();
return [
'filters' => $provider->getFilterConfig(),
'service_manager' => $provider->getDependencyConfig(),
'validators' => $provider->getValidatorConfig(),
'view_helpers' => $provider->getViewHelperConfig(),
];
}
/**
* Register a specification for the TranslatorPluginManager with the ServiceListener.
*
* @param ModuleManager $moduleManager
* @return void
*/
public function init($moduleManager)
{
$event = $moduleManager->getEvent();
$container = $event->getParam('ServiceManager');
$serviceListener = $container->get('ServiceListener');
$serviceListener->addServiceManager(
'TranslatorPluginManager',
'translator_plugins',
'Laminas\ModuleManager\Feature\TranslatorPluginProviderInterface',
'getTranslatorPluginConfig'
);
}
}