-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBootstrap.php
39 lines (31 loc) · 982 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
<?php
/*
* This file is part of the yii2-media project.
*
* (c) Yii2-media project <http://github.com/kmergen/yii2-media/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace kmergen\media;
use yii\base\BootstrapInterface;
use yii\i18n\PhpMessageSource;
/**
* Bootstrap class registers media module and image application component. It also implement the translation for the module also for the fileupload
* widgets.
*
* @author Klaus Mergen <[email protected]>
*/
class Bootstrap implements BootstrapInterface
{
/** @inheritdoc */
public function bootstrap($app)
{
if ($app->hasModule('media') && ($module = $app->getModule('media')) instanceof Module) {
$app->get('i18n')->translations['media*'] = [
'class' => PhpMessageSource::class,
'basePath' => __DIR__ . '/messages',
];
}
}
}