php Laravel 表单方法获取 - url 参数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28396301/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel form method get - url parameters
提问by Kevinvhengst
I got a form in laravel with Method='GET'
我在 Laravel 中得到了一个表单 Method='GET'
{{ Form::open(array('method' => 'get')) }}
I got a few input fields in there: city, skillLevel, province and category
.
When i submit the form i get a awfull url like this:
我在那里有一些输入字段:city, skillLevel, province and category
. 当我提交表单时,我得到了一个像这样的可怕网址:
http://localhost/vacatures?city=somehwhere&skillLevel=junior&province=Zeeland&category=django
but i want something like this:
但我想要这样的东西:
http://localhost/vacatures/somewhere/junior/Zeeland/django
How do i achieve this? I've tried giving at a route attribute and a action actribute, but that didnt work out.
我如何实现这一目标?我试过给一个路由属性和一个动作动作,但这没有奏效。
回答by Xyrus
Maybe this topic will help you - How To Pass GET Parameters To Laravel From With GET Method ?
也许这个主题会帮助你 -如何使用 GET 方法将GET 参数传递给 Laravel ?
There are 2 nice answers, which should suit to your problem.
有 2 个不错的答案,它们应该适合您的问题。