Yii基本配置文件 [ 新手入门 ]
<?php
$params = array_merge(
require(__DIR__ . '/../../../common/config/params.php'),
require(__DIR__ . '/params.php')
);
$config = [
'id' => 'backend',
'name' => 'backend',
'timeZone'=>'Asia/Shanghai',
'language'=>'zh-CN',
'basePath' => dirname(__DIR__),
'controllerNamespace' => 'apps\backend\controllers',
'defaultRoute' => 'dashboard',
'bootstrap' => ['gii'],
'modules' => ['gii' => 'yii\gii\Module',],
'components' => [
'assetManager' => [
'bundles' => [
'yii\web\JqueryAsset' => [
'sourcePath' => null,
'js' => []
],
],
],
'cache'=> [
'class'=> 'yii\caching\FileCache',
],
'admin' => [
'class' => '\yii\web\User',
'identityClass' => 'apps\backend\models\AdminUser',
'idParam' => '_aId',
'identityCookie' => ['name'=>'_aa','httpOnly' => true],
],
'session' => [
'cookieParams' => ['domain' => '.abc.com', 'lifetime' => 0],
'timeout' => 0,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'errorHandler' => [
'errorAction' => 'error',
],
'request' => [
'enableCookieValidation' => true,
'cookieValidationKey' => '8GONNLra_k99w5dOURXuc3bFuWN5WqJm',
],
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'enableStrictParsing' => true,
'showScriptName' => false,
'rules' => [
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
],
],
'mailer' =>[
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// 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' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.exmail.qq.com',
'username' => '',
'password' => '',
'port' => '465',
'encryption' => 'ssl',
],
'messageConfig'=>[
'charset'=>'UTF-8',
'from'=>['422396350@qq.com' => '常岳']
],
]
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = 'yii\debug\Module';
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs'=> ['127.0.0.1', '::1']
];
}
return $config;
共 0 条回复
没有找到数据。
常中蝎 长沙
注册时间:2015-09-14
最后登录:2016-06-08
在线时长:4小时46分
最后登录:2016-06-08
在线时长:4小时46分
- 粉丝1
- 金钱40
- 威望0
- 积分80