简体   繁体   English

Laravel 4错误Symfony \\组件\\ HttpKernel \\异常\\ NotFoundHttpException

[英]Laravel 4 Error Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException

I have this code in my file Routes.php 我的文件Routes.php中有此代码

Route::controller('/cargo/prueba','PruebaController'); 路线::控制器('/ cargo / prueba','PruebaController');

and my file PruebaController have this: 和我的文件PruebaController具有:

<?php
class PruebaController extends BaseController {
    protected $layout = 'layouts.master';
    public function getTipo(){
        //$datos=TipoUsuario::all();
        return View::make('cargo.prueba.pbd');
    }
}

I need the solution to this problem please! 我需要解决这个问题的方法!

Since your root URL in the route declaration is /cargo/prueba so to invoke the getTipo() method in PruebaController controller, your URL would be this: 由于您在路由声明中的根URL/cargo/prueba因此要在PruebaController控制器中调用getTipo()方法, PruebaController URL为:

yourdomain.com/cargo/prueba/tipo

So if you run php artisan routes from terminal/command prompt then you would find the answer; 因此,如果您从终端/命令提示符下运行php artisan routes ,则会找到答案; which will show you the URL to access your method and it's given below: 它将显示给您访问方法的URL ,如下所示:

URL                                                      | Action
------------------------------------------------------------------------------------
cargo/prueba/tipo/{one?}/{two?}/{three?}/{four?}/{five?} | PruebaController@getTipo

So the class should be something like this: 所以该类应该是这样的:

class PruebaController extends BaseController {

    public function getTipo(){

    }
}

暂无
暂无

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

相关问题 Laravel错误Symfony \\ Component \\ HttpKernel \\ Exception \\ NotFoundHttpException - Laravel error Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException Laravel中的Symfony \\ Component \\ HttpKernel \\ Exception \\ NotFoundHttpException错误 - Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException Error in Laravel Laravel 错误 8 Symfony\Component\HttpKernel\Exception\NotFoundHttpException - Laravel error 8 Symfony\Component\HttpKernel\Exception\NotFoundHttpException Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException Laravel - Symfony\Component\HttpKernel\Exception\NotFoundHttpException Laravel Symfony \\组件\\ HttpKernel \\异常\\ NotFoundHttpException Laravel 4.1 - Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException Laravel 4.1 Laravel 5.3中的Symfony \\ Component \\ HttpKernel \\ Exception \\ NotFoundHttpException - Symfony\Component\HttpKernel\Exception\NotFoundHttpException in Laravel 5.3 Symfony\Component\HttpKernel\Exception\NotFoundHttpException - Symfony\Component\HttpKernel\Exception\NotFoundHttpException Symfony \\组件\\ HttpKernel \\异常\\ NotFoundHttpException - Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException Laravel “消息”:“”,“异常”:“Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException”,“文件”: - Laravel “message”: “”, “exception”: “Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException”, “file”: 无法在 Laravel 上捕获“Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException” - Can not catch "Symfony\Component\HttpKernel\Exception\NotFoundHttpException" on laravel
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM