forked from hscstudio/yii2-mailbox
/
Bootstrap.php
48 lines (43 loc) · 894 Bytes
/
Bootstrap.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
<?php
namespace hscstudio\mailbox;
use Yii;
use yii\helpers\ArrayHelper;
/**
* Description of Bootstrap
*
* @author Hafid Mukhlasin
*/
class Bootstrap implements \yii\base\BootstrapInterface
{
public function init()
{
parent::init();
}
/**
*
* @param \yii\web\Application $app
*/
public function bootstrap($app)
{
$mailbox = ArrayHelper::merge(
$app->getModules()['mailbox'],
[
'class' => 'hscstudio\mailbox\Module',
]
);
$app->setModule(
'mailbox', $mailbox
);
if (!empty($app->getModules()['mailbox']['view'])){
$view = $app->getView();
$pathMap=[];
$pathMap['@hscstudio/mailbox/views/default'] = $app->getModules()['mailbox']['view'];
if (!empty($pathMap)) {
$view->theme = Yii::createObject([
'class' => 'yii\base\Theme',
'pathMap' => $pathMap
]);
}
}
}
}