YII2修改默认访问控制器
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" => "yiicachingFileCache", ], "user" => [ "identityClass" => "appmodelsUser", "enableAutoLogin" => true, ], "errorHandler" => [ "errorAction" => "site/error", ], "mailer" => [ "class" => "yiiswiftmailerMailer", // 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" => "yiilogFileTarget", "levels" => ["error", "warning"], ], ], ], "db" => require(__DIR__ . "/db.php"), /* "urlManager" => [ "enablePrettyUrl" => true, "showScriptName" => false, "rules" => [ ], ], */ ], "params" => $params, ];
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: 转:php防止sql注入的一点心得
- 下一篇: yii框架修改默认首页