Controller::detect() 在 Laravel 4 中未定义 [英] Controller::detect() undefined in Laravel 4

查看:23
本文介绍了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 中未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆