TP5.1函数url()出错,与定义的路由不符

浏览:530 发布日期:2019/07/19 分类:求助交流 关键字: 强制路由 url()出错
5.1.37 LTS

啥也不说,上代码:
route.php
Route::domain('admin', function () {
Route::rule('/', 'Index/index')->https();
Route::rule(':action', 'admin/Index/:action')->https()->ext('html');
})->bind('admin');
我想要让二级域名admin访问admin模块,Index控制器。
例如 https://admin.域名/a.html
实际访问 https://admin.域名/admin/index/a
经过测试,路由规则没错,能正确访问。
但 echo url('admin/index/a');
打印结果 /index/a.html
路由不匹配。
我现在需要怎么改?
最佳答案
评论( 相关
后面还有条评论,点击查看>>