-
Notifications
You must be signed in to change notification settings - Fork 5
/
Bootstrap.php
executable file
·39 lines (31 loc) · 1.05 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 veyselsahin\giix;
use yii\base\Application;
use yii\base\BootstrapInterface;
/**
* Class Bootstrap
* @package veyselsahin\giix
* @author Veysel Şahin <[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)
{
if ($app->hasModule('gii')) {
if (!isset($app->getModule('gii')->generators['giix-model'])) {
$app->getModule('gii')->generators['giix-model'] = 'veyselsahin\giix\model\Generator';
}
if (!isset($app->getModule('gii')->generators['giix-crud'])) {
$app->getModule('gii')->generators['giix-crud'] = 'veyselsahin\giix\crud\Generator';
}
if ($app instanceof \yii\console\Application) {
$app->controllerMap['giix-batch'] = 'veyselsahin\giix\commands\BatchController';
}
}
}
}