【发布时间】:2015-04-08 09:32:23
【问题描述】:
我在 laravel 中得到了一个带有 Method='GET' 的表单
{{ Form::open(array('method' => 'get')) }}
我有几个输入字段:city, skillLevel, province and category。
当我提交表单时,我会得到一个这样的网址:
http://localhost/vacatures?city=somehwhere&skillLevel=junior&province=Zeeland&category=django
但我想要这样的东西:
http://localhost/vacatures/somewhere/junior/Zeeland/django
我如何做到这一点?我试过在路由属性和动作属性上给出,但没有成功。
【问题讨论】:
-
恐怕这就是html的工作方式。你可以看看stackoverflow.com/questions/5464481/clean-urls-for-search-query 和matthewjamestaylor.com/blog/… 他们基本上都是黑客,所以我猜没有标准的方法来解决这个问题。
-
好吧,如果我坚持使用丑陋的 url,我该如何使用 Route 来捕捉这个?
-
默认情况下 vacatures 控制器不能使用它吗?