您的位置:首页 > 编程语言 > PHP开发

yii 用户管理 配置文件

2016-03-06 20:55 555 查看
<pre name="code" class="php"><?php

return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=dby2',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'tablePrefix'=>'tb_',
];


<?php$params = require(__DIR__ . '/params.php');$config = [ 'id' => 'basic', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'components' => [ 'request' => [ // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'fUb-g6QPavwsok09_bun_LNDkTMUAYy0', ], 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'user' => [ 'identityClass' => 'app\models\User', 'enableAutoLogin' => true, ], 'errorHandler' => [ 'errorAction' => 'site/error', ], 'mailer'
=> [ 'class' => 'yii\swiftmailer\Mailer', // send all mails to a file by default. You have to set // 'useFileTransport' to false and configure a transport // for the mailer to send real emails. 'useFileTransport' => true, ], 'log' => [ 'traceLevel' => YII_DEBUG
? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], ], ], ], 'db' => require(__DIR__ . '/db.php'), ], 'params' => $params, 'modules' => [ 'admin' => [ 'class' => 'app\modules\admin\Module', ], ], //指定默认控制器 'defaultRoute'=>"admin/index/main",
];if (YII_ENV_DEV) { // configuration adjustments for 'dev' environment $config['bootstrap'][] = 'debug'; $config['modules']['debug'] = [ 'class' => 'yii\debug\Module', ]; $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = [ 'class' => 'yii\gii\Module',
];}return $config;


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: