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