Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 L4 中,是否有 L3 的等价物Route::controller(Controller::detect());?
Route::controller(Controller::detect());
我认为没有等价物,但注册控制器很容易:
Route::controller('users', 'UserController');
控制器方法接受两个参数。第一个是控制器处理的基本 URI,而第二个是控制器的类名。
这很可能不会在 laravel 4 中实现,原因是自动加载所有控制器被设计破坏了。在 laravel 中,定义控制器的顺序很重要,这意味着自动加载所有控制器可能会破坏您的应用程序。