Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多应用think-multi-app从TP6升级tp8.1的路由问题 #3121

Closed
Y-A-K-E opened this issue Feb 21, 2025 · 2 comments
Closed

多应用think-multi-app从TP6升级tp8.1的路由问题 #3121

Y-A-K-E opened this issue Feb 21, 2025 · 2 comments
Labels

Comments

@Y-A-K-E
Copy link

Y-A-K-E commented Feb 21, 2025

原来tp6的时候,默认应用是blog,并绑定了子域名blog.

blog应用的路由文件
app\blog\route\blog.php

//博客内容页面路由
Route::get('show/:id', 'blog/index/show')
    ->pattern(['id' => '\d+']);

原来访问路径
blog域名/show/1.html 是可以访问的

现在升级到tp8.1后,会404
controller not exists:app\blog\controller\blog\Index


必须把路由要改成,这样才能访问.

//博客内容页面路由
Route::get('show/:id', 'index/show') 
    ->pattern(['id' => '\d+']);

请问是都要这样改吗? 还是我哪里设置不对?

@big-dream
Copy link
Contributor

后面这种应该才是规范的,因为应用之间应该是相对独立的,所以没必要带应用名

@Y-A-K-E
Copy link
Author

Y-A-K-E commented Feb 21, 2025

后面这种应该才是规范的,因为应用之间应该是相对独立的,所以没必要带应用名

原来如此,那可能是我开始就用错误的方式跑起来了.

谢谢.

@Y-A-K-E Y-A-K-E closed this as completed Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants