【发布时间】:2012-11-30 08:16:11
【问题描述】:
在我的 Laravel 项目中,我有以下文件夹结构
application/controllers/products.php
application/controllers/products/categories.php
在我的products.php
class Products_Controller extends Base_Controller {
public $restful = true;
public function get_index()
{
$data['title'] = 'Products List';
return View::make('product.index',$data);
}
}
在我的categories.php
class Products_Categories_Controller extends Base_Controller{
public $restful = true;
public function get_index(){
$data['title'] = "All Categtories";
return View::make('category.index', $data);
}
}
这是我的routes.php
Route::get('products', array('as' => 'products', 'uses' => 'products@index'));
Route::get('products/categories', array('as' => 'categories', 'uses' => 'categories@index'));
当我浏览example.com/products/categories 时,我收到了 404 错误消息。我的routes.php怎么了
【问题讨论】:
-
您是否为您的服务器设置了适当的重写规则?
-
是的.. 网站运行良好.. 但我无法进入分类页面