-
Notifications
You must be signed in to change notification settings - Fork 98
/
Bootstrap.php
44 lines (39 loc) · 1.49 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
41
42
43
44
<?php
/**
* @link http://www.diemeisterei.de/
* @copyright Copyright (c) 2014 diemeisterei GmbH, Stuttgart
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace mootensai\enhancedgii;
use yii\base\Application;
use yii\base\BootstrapInterface;
/**
* Class Bootstrap
* @package mootensai\yii2-enhanced-gii
* @author Tobias Munk <[email protected]>
*/
class Bootstrap implements BootstrapInterface
{
/**
* Bootstrap method to be called during application bootstrap stage.
*
* @param Application $app the application currently running
*/
public function bootstrap($app)
{
// \Yii::setAlias('@mtengii','@vendor/mootensai/yii2-enhanced-gii');
if ($app->hasModule('gii')) {
if (!isset($app->getModule('gii')->generators['enhanced-gii'])) {
$app->getModule('gii')->generators['enhanced-gii-model'] = 'mootensai\enhancedgii\model\Generator';
$app->getModule('gii')->generators['enhanced-gii-crud']['class'] = 'mootensai\enhancedgii\crud\Generator';
// $app->getModule('gii')->generators['enhanced-gii-crud']['templates'] = [
// 'default' => '@mtengii/crud/default',
// 'nested' => '@mtengii/crud/nested'
// ];
$app->getModule('gii')->generators['enhanced-gii-migration'] = 'mootensai\enhancedgii\migration\Generator';
}
}
}
}