其他分享
首页 > 其他分享> > Yii初始化环境配置

Yii初始化环境配置

作者:互联网

1.入口文件添加

error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING);
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

 

 

2.gii,debug模块

在admin/config/main-local.php 追加代码

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => \yii\debug\Module::class,
        'panels' => [
            'queue' => \yii\queue\debug\Panel::class,
        ],
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'allowedIPs' => ['127.0.0.1', '::1', '192.168.*.*'],
    ];
}

 

标签:初始化,yii,YII,配置,Yii,debug,config,class,gii
来源: https://www.cnblogs.com/echojson/p/12626921.html