我正在使用Laravel 5.1和模块化软件包:https://github.com/Artem-Schander/L5Modular
我使用以下路由文件创建了一个管理模块:
Route::group(array('module' => 'Admin', 'namespace' => 'App\Modules\Admin\Controllers'), function() {
Route::get('admin/test', 'AdminController@createTestView');
});
当我调用http://localhost/admin/test时,它会将我重定向到测试视图 . 当我调用http://localhost/admin/test2时,它会将我重定向到我的404.blade.php文件,该文件是为不再存在的页面创建的 .
当我调用http://localhost/admin时,我在浏览器中收到以下错误消息:"The requested resource /Site was not found on this server."
任何想法为什么它不会重定向到404.blade.php网站?谢谢
1 回答
您没有
admin/test2
的路由,'s why you'收到404错误 . 如果要将ID传递给控制器,则应使用参数创建路径:admin/test{id}
UPDATE:
然后在
createTestView
动作中: