Zend 删除 url 重定向中的锚文本
我有一个使用锚点名称作为其操作的表单,以便在提交表单时它会直接返回到表单(例如“www.domain.com/page#contact-form”)。我们的想法是,如果有任何错误,它将直接进入表单(靠近页面底部),以便您可以看到错误并继续填写表单。如果表单有效,我希望它重定向到另一个页面(例如 www.domain.com/another-page)。问题是重定向 URL 中仍然包含锚文本(在上面的示例中为 www.domain.com/another-page#contact-form)。
我用来
$this->_helper->redirector->goToRouteAndExit(array(), 'another-page', true);
转到另一页路线。我已经尝试专门设置 url,但这也无法解决问题。
如何重定向到另一个页面并从网址中删除该锚文本?
I have a form that is using an anchor name as it's action so that when the form is submitted it is it goes straight back to the form (for example 'www.domain.com/page#contact-form). The idea is if there are any errors then it'll go straight to the form (that's near the bottom of the page) so you can see the errors and continue filling in the form. If the form is valid, I want it to redirect to another page (for example www.domain.com/another-page). The problem is that the redirect url still has the anchor text in the url (in the above example it is www.domain.com/another-page#contact-form).
I am using
$this->_helper->redirector->goToRouteAndExit(array(), 'another-page', true);
to goto the another-page route. I have tried setting the url specifically but that doesn't fix it either.
How do I redirect to another page and remove that anchor text from the url?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我本以为你可以做这样的事情:
有什么用吗?
编辑:假设您正在使用 Zend_Form/Zend_Dojo_Form
I would have presumed that you could do something like:
Any use?
Edit: Assuming that you are using Zend_Form/Zend_Dojo_Form