'console', 'controllerNamespace' => 'app\commands', 'language'=>$params['language'], 'bootstrap' => ['log'], //'defaultRoute'=>'user',//设置默认的控制器 'aliases' => [ '@bower' => '@vendor/bower-asset', '@npm' => '@vendor/npm-asset', ], 'components' => [ 'cache' => [ 'class' => 'yii\caching\FileCache', ], 'log' => [ 'targets' => [ [ 'class' => 'yii\log\FileTarget', 'levels' => ['error', 'warning'], ], ], ], 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'viewPath' => BASE_PATH.'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' => $params['mailer']['host'], 'username' => $params['mailer']['username'], 'password' => $params['mailer']['password'], 'port' => $params['mailer']['port'], 'encryption' => $params['mailer']['encryption'], ], 'messageConfig'=>[ 'charset'=>'UTF-8', 'from'=>[$params['mailer']['fromname']=>$params['mailer']['fromtitle']] ], ], ], 'params' => $params, ]; if (YII_ENV_DEV) { // configuration adjustments for 'dev' environment $config['bootstrap'][] = 'gii'; $config['modules']['gii'] = [ 'class' => 'yii\gii\Module', ]; } $config['components'] = array_merge($config['components'],$db); return $config;