2014-03-03 80 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 
}