/
Module.php
77 lines (65 loc) · 2.08 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* Kapitchi Zend Framework 2 Modules (http://kapitchi.com/)
*
* @copyright Copyright (c) 2012-2013 Kapitchi Open Source Team (http://kapitchi.com/open-source-team)
* @license http://opensource.org/licenses/LGPL-3.0 LGPL 3.0
*/
namespace KapSearch;
use Zend\EventManager\EventInterface,
Zend\ModuleManager\Feature\ControllerProviderInterface,
Zend\ModuleManager\Feature\ServiceProviderInterface,
Zend\ModuleManager\Feature\ViewHelperProviderInterface,
KapitchiBase\ModuleManager\AbstractModule;
class Module extends AbstractModule
implements ServiceProviderInterface, ControllerProviderInterface, ViewHelperProviderInterface
{
public function onBootstrap(EventInterface $e) {
parent::onBootstrap($e);
}
public function getControllerConfig()
{
return array(
'factories' => array(
'KapSearch\Controller\GlobalSearch' => function($sm) {
$ins = new Controller\GlobalSearchController(
$sm->getServiceLocator()->get('KapSearch\Form\Search'),
$sm->getServiceLocator()->get('KapSearch\Service\SearchEngine')
);
return $ins;
},
)
);
}
public function getViewHelperConfig()
{
return array(
'factories' => array(
'XXX' => function($sm) {
$ins = new View\Helper\Test();
return $ins;
},
)
);
}
public function getServiceConfig()
{
return array(
'invokables' => array(
//'KapAuction\Entity\Auction' => 'KapAuction\Entity\Auction',
),
'factories' => array(
'KapSearch\Form\Search' => function ($sm) {
$ins = new Form\Search();
return $ins;
},
)
);
}
public function getDir() {
return __DIR__;
}
public function getNamespace() {
return __NAMESPACE__;
}
}