我用Laravel制作了页面,我用一个很好的URL路由它们,但是我正在开发一个房地产网站,我想为一个显示一所房子信息的页面提供以下网址:houseinfo/{town}/{neighborhood}/{street}/{houseID}
{town} {neighborhood} {street} and {houseID}等我怎样才能传送这个页面?谢谢!
发布于 2014-03-03 15:16:32
你可以这样做:
Route::get('/houseinfo/{town}/{neighborhood}/{street}/{houseID}', array(
'as' => 'houseinfo',
'uses' => 'HouseController@houseInfo'
));然后,在HouseController中,可以使用以下参数添加方法:
public function houseInfo($town, $neighborhood, $street, $houseID){
// get the data from the model
}https://stackoverflow.com/questions/22145539
复制相似问题