[英]getFormAction() returns empty string
I am embedding the contacts form onto a CMS page with this bit of layout XML: 我将使用以下布局XML将联系人表单嵌入到CMS页面上:
<reference name="content">
<block type="core/template" name="cmsContactForm" form_action="/contacts/index/post" template="contacts/form.phtml"></block>
</reference>
However, when I am on that CMS page this bit of code on the contacts form page: 但是,当我在那个CMS页面上时,联系人表单页面上的以下代码:
<form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">
The getFormAction()
method returns an empty string, resulting in the contact form failing as it just refreshes the page instead of submitting the information in the contact form. getFormAction()
方法返回一个空字符串,导致联系表单失败,因为它仅刷新页面而不是在联系表单中提交信息。
Can anyone tell me how to get a proper form action from getFormAction()
? 谁能告诉我如何从
getFormAction()
获得适当的表单动作?
Is there a relevant helper that I can employ on a CMS page? 我可以在CMS页面上使用相关的帮助程序吗?
尝试
<form action="<?php echo Mage::getUrl('contacts/index/post', array('_secure' => $this->getRequest()->isSecure())); ?>" id="contactForm" method="post">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.