YII2修改默认访问控制器
2016-10-25 12:52
246 查看
config/web.php
$config = [
'id' => 'basic',
'defaultRoute'=>'index', //默认访问的控制器
'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' => 'VAfHNQlWiKkw857IOAMyFqoW5XwLG2zW',
],
'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'),
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];
$config = [
'id' => 'basic',
'defaultRoute'=>'index', //默认访问的控制器
'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' => 'VAfHNQlWiKkw857IOAMyFqoW5XwLG2zW',
],
'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'),
/*
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
],
],
*/
],
'params' => $params,
];
相关文章推荐
- 关于YII2如何修改默认控制器的问题
- Yii2修改默认控制器
- 关于YII2如何修改默认控制器的问题
- YII2如何修改默认控制器/方法
- 关于YII2如何修改默认控制器的问题
- Yii2 修改控制器 默认首页
- 关于yii2和laravel默认访问控制器和方法名的设置
- yii2修改默认控制器
- yii2存session修改默认控制器
- 修改Tomcat的默认访问目录
- 访问的默认url - yii2
- MVC模型流程初步介绍-访问页面及更改默认控制器
- 怎么修改tomcat默认访问首页
- [ubantu][apache2]修改默认的访问路径
- yii 2.0.6 修改默认控制器
- wdcp 如何创建用IP就可以访问的默认站点/修改默认站点
- linux修改tomcat默认访问项目
- yii2.0 修改默认控制器
- Https访问Google Chrome,修改默认搜索引擎。
- 修改chrome默认搜索引擎访问