2014-09-21 94 views
0

我在文件中有此代碼routes.php文件Laravel 4錯誤的Symfony 元器件 HttpKernel 異常 NotFoundHttpException

路線::控制器( '/貨物/ prueba', 'PruebaController');

和我的文件PruebaController有這樣的:

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

我需要解決這個問題,請!

+0

你訪問什麼網址?也請修改代碼格式,不要使用'內聯代碼'(帶反引號)用於多行代碼,而是用4個空格縮進所有內容(或者只需選中它並按編輯器工具欄中的大括號按鈕)。 – 2014-09-21 06:32:49

回答

0

由於根URL在路由聲明/cargo/prueba所以調用getTipo()方法PruebaController控制器,你URL會是這樣:

yourdomain.com/cargo/prueba/tipo 

因此,如果您從終端php artisan routes /命令提示符,然後你會找到答案;它會顯示你的URL訪問您的方法和它的如下:

URL              | Action 
------------------------------------------------------------------------------------ 
cargo/prueba/tipo/{one?}/{two?}/{three?}/{four?}/{five?} | [email protected] 

所以類應該是這樣的:

class PruebaController extends BaseController { 

    public function getTipo(){ 

    } 
} 
相關問題