forked from c006/yii2-migration-utility
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
55 lines (44 loc) · 1.11 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
52
53
54
55
<?php
/**
* Created by PhpStorm.
* User: user
* Date: 6/7/14
* Time: 7:24 PM
*/
namespace c006\utility\migration;
/**
* Class Module
*
* @package c006\utility\migration
*/
class Module extends \yii\base\Module
{
/**
*
*/
const VERSION = '0.0.1-dev';
/**
* @var string
*/
public $controllerNamespace = 'c006\utility\migration\controllers';
/**
*
*/
public function init()
{
parent::init();
}
/**
* Override createController()
*
* @link https://github.com/yiisoft/yii2/issues/810
* @link http://www.yiiframework.com/forum/index.php/topic/21884-module-and-url-management/
*/
public function createController($route)
{
preg_match('/(default)/', $route, $match);
if ( isset($match[0]) )
return parent::createController($route);
return parent::createController("{$this->defaultRoute}/{$route}");
}
}