Controller::detect() undefined in Laravel 4(Controller::detect() 在 Laravel 4 中未定义)
问题描述
尝试在 Laravel 4 (Illuminate) 中注册所有控制器路由时,我收到一条错误消息,方法是添加:
I am getting an error message when trying to register all the controller routes in Laravel 4 (Illuminate) by adding:
Route::controller(Controller::detect());
到我的 routes.php
错误:
Error: Call to undefined method IlluminateRoutingControllersController::detect() in C:wampwww ravlessapp
outes.php line 13
我想他们更改了函数名称,但我不知道在哪里可以找到它,因为它仍然是 alpha 版本并且没有我知道的文档.
I suppose they changed the function name, but I don't know where to find it because it is still an alpha version and there is no documentation I'm aware of.
推荐答案
由于不同文件系统的行为不一致,该函数已在 Laravel 4 中删除.注册控制器的正确方法应该是明确定义您希望在路由文件中使用的每一个.
This function has been removed in Laravel 4 because of inconsistent behavior with varying filesystems. The proper way to register controllers should be to explicitly define each one you wish to use in your routes file.
这篇关于Controller::detect() 在 Laravel 4 中未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Controller::detect() 在 Laravel 4 中未定义


基础教程推荐
- php中的PDF导出 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- php中的foreach复选框POST 2021-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- Web 服务器如何处理请求? 2021-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01