简体   繁体   English

Route.php行中的ReflectionException

[英]ReflectionException in Route.php line

<?php 
class Myform  extends Controller
{
    public function index()
    {
        return view('form');
    }
}
?>

the code of routes 路线的代码

Route::get('/myform', 'Myform@ndex');

and the error is 而错误是

ReflectionException in Route.php line 264: Method App\\Http\\Controllers\\Myform::ndex() does not exist Route.php第264行中的ReflectionException:方法App \\ Http \\ Controllers \\ Myform :: ndex()不存在

change from 改变

Route::get('/myform', 'Myform@ndex');

to

Route::get('/myform', 'Myform@index');

You did a typing mistake index instead of ndex 你输入了错误索引而不是ndex

Route::get('/myform', 'Myform@index');

instead 代替

Route::get('/myform', 'Myform@ndex');

Remove / before myform , you don't need to put it. 删除/myform之前,你不需要把它。

Declare the route as follows: Route::get('myform', 'Myform@index'); 声明路由如下: Route::get('myform', 'Myform@index');

In your controller file add namespace App\\Http\\Controllers; 在你的控制器文件中添加namespace App\\Http\\Controllers; at the top of your code. 在代码的顶部。

<?php 
namespace App\Http\Controllers;
class Myform  extends Controller
{
    public function index()
    {
        return view('form');
    }
}
?>

Hope this will work. 希望这会奏效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Route.php第281行的ReflectionException:函数()不存在 - ReflectionException in Route.php line 281: Function () does not exist Route.php第335行中的ReflectionException:Function()不存在 - ReflectionException in Route.php line 335: Function () does not exist Route.php第335行中的ReflectionException:Function()不存在,不知道为什么 - ReflectionException in Route.php line 335: Function () does not exist don't know why Route.php行339中的ReflectionException:Laravel 5.3中不存在类App \\ Http \\ Requests \\ CreateTenantRequest - ReflectionException in Route.php line 339: Class App\Http\Requests\CreateTenantRequest does not exist in Laravel 5.3 Route.php行333中的ReflectionException:方法App \\ Http \\ Controllers \\ DbImportController :: csv()不存在 - ReflectionException in Route.php line 333: Method App\Http\Controllers\DbImportController::csv() does not exist Route.php行333中的ReflectionException:方法App \\ Http \\ Controllers \\ Auth \\ LoginController :: mail()不存在 - ReflectionException in Route.php line 333: Method App\Http\Controllers\Auth\LoginController::mail() does not exist 如何解决:Route.php第333行的ReflectionException:Laravel 5.3中的方法App \\ Http \\ Controllers \\ PerekamanController :: show()不存在? - How to resolve : ReflectionException in Route.php line 333: Method App\Http\Controllers\PerekamanController::show() does not exist" in Laravel 5.3? 在第48行上安装joomla,route.php时出错 - error in installing joomla , route.php on line 48 UnexpectedValueException in Route.php line 639: Invalid route action: [App\\Http\\Controllers\\PortfolioController] - UnexpectedValueException in Route.php line 639: Invalid route action: [App\Http\Controllers\PortfolioController] Hash :: make无法正常工作route.php文件 - Hash::make not working route.php file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM