-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathBootstrap.php
38 lines (34 loc) · 1.07 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
<?php
namespace funson86\blog;
use yii\base\BootstrapInterface;
/**
* Blogs module bootstrap class.
*/
class Bootstrap implements BootstrapInterface
{
/**
* @inheritdoc
*/
public function bootstrap($app)
{
// Add module URL rules.
/*$app->getUrlManager()->addRules(
[
'POST <_m:blogs>' => '<_m>/user/create',
'<_m:blogs>' => '<_m>/default/index',
'<_m:blogs>/<id:\d+>-<alias:[a-zA-Z0-9_-]{1,100}+>' => '<_m>/default/view',
]
)*/;
// Add module I18N category.
if (!isset($app->i18n->translations['funson86/blog']) && !isset($app->i18n->translations['funson86/*'])) {
$app->i18n->translations['funson86/blog'] = [
'class' => 'yii\i18n\PhpMessageSource',
'basePath' => '@funson86/blog/messages',
'forceTranslation' => true,
'fileMap' => [
'funson86/blog' => 'blog.php',
]
];
}
}
}