-
Notifications
You must be signed in to change notification settings - Fork 9
/
Bootstrap.php
executable file
·40 lines (36 loc) · 1.16 KB
/
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
<?php
namespace vova07\users;
use yii\base\BootstrapInterface;
/**
* Users module bootstrap class.
*/
class Bootstrap implements BootstrapInterface
{
/**
* @inheritdoc
*/
public function bootstrap($app)
{
// Add module URL rules.
$app->urlManager->addRules(
[
'<_a:(login|signup|activation|recovery|recovery-confirmation|resend|fileapi-upload)>' => 'users/guest/<_a>',
'<_a:logout>' => 'users/user/<_a>',
'<_a:email>' => 'users/default/<_a>',
'my/settings/<_a:[\w\-]+>' => 'users/user/<_a>',
],
false
);
// Add module I18N category.
if (!isset($app->i18n->translations['vova07/users']) && !isset($app->i18n->translations['vova07/*'])) {
$app->i18n->translations['vova07/users'] = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@vova07/users/messages',
'forceTranslation' => true,
'fileMap' => [
'vova07/users' => 'users.php',
]
];
}
}
}