2014-03-03 82 views
0

我已经页面与Laravel我的路线他们用一个漂亮的URL,但我正在开发一个房地产网站,我想有一个页面,显示以下网址一个房子的信息:houseinfo/{town}/{neighborhood}/{street}/{houseID}LARAVEL 4溶液动态SEO网址想

  1. 我的数据库我有一个表房屋所有房屋的记录。
  2. 每个记录等等

{town} {neighborhood} {street} and {houseID}我怎能路线这个网页? 谢谢!

回答

1

你可以做这样的:

Route::get('/houseinfo/{town}/{neighborhood}/{street}/{houseID}', array(
    'as' => 'houseinfo', 
    'uses' => '[email protected]' 
)); 

然后,在HouseController,你可以用这个参数添加方法:

public function houseInfo($town, $neighborhood, $street, $houseID){ 
    // get the data from the model 
}