forked from mithun12000/adminUI
/
AdminUiBootstrap.php
54 lines (49 loc) · 2.07 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
<?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->set('assetManager' , [
'class' => 'yii\web\AssetManager',
'bundles' => [
'yii\widgets\ActiveFormAsset' => [
'js' => [],
'depends' => [
'yii\adminUi\assetsBundle\AdminUiActiveForm',
],
],
'yii\grid\GridViewAsset' => [
'depends' => [
'app\assets\AppAsset'
],
],
],
'linkAssets' => true,
]);
Event::on(Controller::className(), Controller::EVENT_BEFORE_ACTION, function ($event) {
if(in_array($event->action->id,['login','forgot','reset-password']) && in_array('backend', explode("\\", $event->sender->className()))){
$event->sender->layout = '//blank';
}
});
}
}