-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModule.php
51 lines (44 loc) · 1.04 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
<?php
namespace yuncms\question;
use Yii;
/**
* This is the main module class for the QA module.
*
* To use QA, include it as a module in the application configuration like the following:
*
* ~~~
* return [
* ......
* 'modules' => [
* 'question' => ['class' => 'yuncms\question\Module'],
* ],
* ]
* ~~~
*
* With the above configuration, you will be able to access QA Module in your browser using
* the URL `http://localhost/path/to/index.php?r=question`
*
* You can then access QA via URL: `http://localhost/path/to/index.php/question`
*/
class Module extends \yii\base\Module
{
/**
* 初始化
*/
public function init()
{
parent::init();
$this->registerTranslations();
}
/**
* 注册语言包
*/
public function registerTranslations()
{
Yii::$app->i18n->translations['question*'] = [
'class' => 'yii\i18n\PhpMessageSource',
'sourceLanguage' => 'en-US',
'basePath' => __DIR__ . '/messages',
];
}
}