博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
TP6 绑定admin/index模块 登录管理 (多应用设置)
阅读量:2123 次
发布时间:2019-04-30

本文共 501 字,大约阅读时间需要 1 分钟。

如果要设置:index、admin等模块时,就是需要多应用

官方文档:

 

1.安装多应用模式扩展think-multi-app。

composer require topthink/think-multi-app

2.删除掉app下的controller文件夹(可能也不用)

3.新建index和admin应用文件夹,并在各自下方创建controller,建立index文件

用命令形式创建:(在根目录下)

搞定浏览 :

 

4.如果想这样访问,不用输入index方法

在public文件夹下,创建同名admin.php文件

admin.php代码

// [ 应用入口文件 ]namespace think;require __DIR__ . '/../vendor/autoload.php';// 执行HTTP应用并响应$http = (new  App())->http;$response = $http->run();$response->send();$http->end($response);

多应用使用不同的入口的情况下,每个入口文件的内容都是一样的,默认入口文件名(不含后缀)就是应用名。

 

 

转载地址:http://pgdrf.baihongyu.com/

你可能感兴趣的文章
Leetcode C++《热题 Hot 100-27》17.电话号码的字母组合
查看>>
Leetcode C++《热题 Hot 100-28》19.删除链表的倒数第N个节点
查看>>
Leetcode C++《热题 Hot 100-29》22.括号生成
查看>>
Leetcode C++《热题 Hot 100-40》64.最小路径和
查看>>
Leetcode C++《热题 Hot 100-41》75.颜色分类
查看>>
Leetcode C++《热题 Hot 100-42》78.子集
查看>>
Leetcode C++《热题 Hot 100-43》94.二叉树的中序遍历
查看>>
Leetcode C++ 《第175场周赛-1 》5332.检查整数及其两倍数是否存在
查看>>
Leetcode C++ 《第175场周赛-2 》5333.制造字母异位词的最小步骤数
查看>>
Leetcode C++ 《第175场周赛-3》1348. 推文计数
查看>>
Leetcode C++《热题 Hot 100-44》102.二叉树的层次遍历
查看>>
Leetcode C++《热题 Hot 100-45》338.比特位计数
查看>>
读书摘要系列之《kubernetes权威指南·第四版》第一章:kubernetes入门
查看>>
Leetcode C++《热题 Hot 100-46》739.每日温度
查看>>
Leetcode C++《热题 Hot 100-47》236.二叉树的最近公共祖先
查看>>
Leetcode C++《热题 Hot 100-48》406.根据身高重建队列
查看>>
《kubernetes权威指南·第四版》第二章:kubernetes安装配置指南
查看>>
Leetcode C++《热题 Hot 100-49》399.除法求值
查看>>
Leetcode C++《热题 Hot 100-51》152. 乘积最大子序列
查看>>
[Kick Start 2020] Round A 1.Allocation
查看>>