我正在尝试访问以下URL:
www.mysite.com/user/dash/sales
在我的控制器目录中,有一个DashboardController.php文件:
<?php
class DashboardController extends BaseController {
public function __construct() {
$this->beforeFilter('auth');
}
/**
* Supplier's dashboard screen
*
*/
public function getSupplier()
{
$this->layout->content = View::make('user.dashboard.supplier');
}
/**
* Sales dashboard screen
*
*/
public function getSales()
{
$this->layout->content = View::make('user.dashboard.sales');
}
/**
* Admin's dashboard screen
*
*/
public function getAdmin()
{
$this->layout->content = View::make('user.dashboard.admin');
}
}
我已经在routes.php文件中尝试了以下所有可能性,但没有成功:
Route::any('user/dash/(:any)', array('uses' => 'DashboardController') );
Route::controller( 'user/dash', 'DashboardController' );
Route::group(array('prefix' => 'user', 'before' => 'auth'), function()
{
Route::controller('dash', 'DashboardController');
});
有没有其他建议?我不太确定如何使这成为一个成功的路线。所有这些路线都会出现以下错误信息:
找不到控制器方法。