一旦在路由中使用 绑定到命名空间namespace(),多级控制器提示类找不到

Open Beginner friendly
#3,199 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
php
Domain
backend

Research direction

Start in think\route\Rule.php around parseRule() at line 699, then reproduce the reported Route group with namespace('app\index\controller') and the nested user.Blog/index controller route. Check how the route is converted into a controller class name. Done means the route resolves the intended namespaced controller without ClassNotFoundException.

Written by the indexing model from the issue text.

Description

bug
所属功能组件

路由(Route)

ThinkPHP 版本

8.1.4

操作系统

Linux

错误信息

“#0 [0]ClassNotFoundException in Callback.php line 108

类不存在:app\index\controller\user.blog

其它说明

Route::group('',function(){ Route::get('user/blog','user.Blog/index'); }) ->namespace('app\index\controller');

大概,think\route\Rule.php 699行 parseRule().字符没有转换

Dominant language
PHP
Stars
2.8k
Forks
1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from top-think/framework

All issues in top-think/framework

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.