企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 第4章 项目后台页面的搭建 ## 访问脚手架GII - 开启gii - 页面访问:index.php?r=gii ## 创建 admin 模块 (module) ![](https://box.kancloud.cn/39183e0269d36093fcc7b2e5580f07a7_1172x947.jpg) To access the module, you need to add this to your application configuration ``` ...... 'modules' => [ 'admin' => [ 'class' => 'app\modules\admin', ], ], ...... ``` 访问admin模块:/index.php?r=admin ## 创建页面 后台登录页: *\modules\controllers\PublicController.php* ``` <?php namespace app\modules\controllers; class PublicController extends \yii\web\Controller { public function actionLogin() { $this->layout = false; return $this->render('login'); } } ``` ## 设置 修改默认属性。默认属性为 public $defaultRoute = 'site'; ## 设置URL格式 配置文件: ``` 'urlManager' => [ 'enablePrettyUrl' => true, 'suffix' => '.html', 'rules' => [ ], ], ``` https://www.yiichina.com/doc/guide/2.0/runtime-routing