请教
thinkPHP6.0自动多应用模式路由怎么配置?
文件夹结构
创建[admin,index]
两个应用
应用控制器代码(index应用)
<?php
namespace app\index\controller;
use app\BaseController;
use think\facade\Db;
use think\facade\View;
class index extends BaseController
{
public function index()
{
$res = Db::name('members')->where('username', 'wuyu001')->select();
return $res;
}
public function login()
{
echo 'niha';
}
}
全路径访问结果
全路径访问正常
路由文件代码
<?php
use think\facade\Route;
Route::get('think', function () {
return 'hello,ThinkPHP6!';
});
Route::get('/login', 'index');
简化(路由)url访问
访问报错:控制器不存在
请名仕解答,tinkPHP入门小子,问题低级请体谅