简体   繁体   English

使用GET提交表单时使用Symfony2友好的url

[英]Symfony2 friendly url on form submission with GET

I have a problem when submitting a form and send the params with get method. 提交表单并使用get方法发送参数时出现问题。

In browser address bar it shows not friendly url, like: - http://www.myDomainApp.com/app_dev.php/user/list?limit=10&offset=0 在浏览器地址栏中,它显示的网址不友好,例如:-http://www.myDomainApp.com/app_dev.php/user/list?limit=10&offset =0

and I expected some like: - http://www.myDomainApp.com/app_dev.php/user/list/10/0 并且我希望像这样: -http : //www.myDomainApp.com/app_dev.php/user/list/10/0

Anybody knows why, and how can I do the friendly url? 谁知道为什么,我该怎么做友好的网址?

I found an explanation here of my problem, but I think this is not symfony 2.x. 我在这里找到了关于我的问题的解释,但是我认为这不是symfony2.x。 PS : I am using yml files for routing not annotations. PS:我使用yml文件路由而不是注释。

Please help. 请帮忙。

Anybody knows why 谁知道为什么

Because that is how the form submission process is defined in the HTML specification. 因为这就是在HTML规范中定义表单提交过程的方式。

and how can I do the friendly url? 我该如何做友好的网址?

Process the form data and issue a 301 redirect from the server. 处理表单数据并从服务器发出301重定向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM