forked from mithun12000/adminUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AdminUiBootstrap.php
59 lines (55 loc) · 2.03 KB
/
AdminUiBootstrap.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
56
57
58
59
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace yii\adminUi;
use Yii;
use yii\base\Application;
use yii\base\BootstrapInterface;
use yii\web\Controller;
use yii\base\Event;
class AdminUiBootstrap implements BootstrapInterface{
public function bootstrap($app){
\Yii::$classMap = array_merge(\Yii::$classMap,[
'yii\grid\CheckboxColumn'=>'@yii/adminUi/widget/CheckboxColumn.php',
'yii\grid\ActionColumn'=>'@yii/adminUi/widget/ActionColumn.php',
]);
$app->set('view', [
'class'=>'yii\web\View',
'theme' => [
'pathMap' => ['@backend/views' => '@backend/themes/adminui'], // for Admin theme which resides on extension/adminui
'baseUrl' => '@web/themes/adminui',
],
]);
$app->setModule('adminuidemo',['class'=>'yii\adminUi\module\Module']);
$app->set('assetManager' , [
'class' => 'yii\web\AssetManager',
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'sourcePath' => null,
'css' => []
],
'yii\bootstrap\BootstrapPluginAsset' => [
'sourcePath' => null,
'js' => []
],
'yii\grid\GridViewAsset' => [
'depends' => [
'backend\assets\AppAsset'
],
],
'backend\assets\AppAsset' => [
'css' => [],
],
],
'linkAssets' => true,
]);
Event::on(Controller::className(), Controller::EVENT_BEFORE_ACTION, function ($event) {
if($event->action->id == 'login' && in_array('backend', explode("\\", $event->sender->className()))){
$event->sender->layout = '//blank';
}
});
}
}