Magento - 提交表单后 php 文件 subscribe.phtml 调用的位置
当您提交时事通讯订阅表单 (subscribe.phtml) 时,表单操作将包含一个 php 文件。有谁知道它位于哪里?
编辑:我如何将表单操作发送到执行邮件发送位的自定义 php?例如,我希望表单处理由名为 sendmail.php 的文件完成,
我正在尝试使用类似的内容 - 相反,如果默认操作 getUrl('newsletter/subscriber/new') ?>">
谢谢
When you submit the newsletter subscription form (subscribe.phtml), the form actions aclls a php file. Does anyone know where it is located?
EDIT: And how can I send the form action to a custom php which does the mail sending bit? for example, I want the form handling to be done by a file called sendmail.php
i'm trying to have something like this - instead if the default action getUrl('newsletter/subscriber/new') ?>">
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Magento 被锁定在 MVC 框架中,因此用任意 PHP 文件替换框架代码将会很困难。如果您提供与核心代码不同的更多详细信息,我们可以帮助您确定要进行哪些更改。
谢谢,
Joe
从臀部射击,看看本教程 关于如何创建控制器。一般来说,您在这里要做的是创建一个操作来接收您的表单帖子,然后执行您需要的任何代码。
因此,您将通过使用名为
somethingAction
的方法创建MyModule_controllers_Somecontroller
来定义http://mystore.com/somecontroller/something
。通过一些更详细的信息,我可以为您找到更具体的示例。Magento is locked into an MVC framework, so replacing the framework code with an arbitrary PHP file is going to be difficult. If you give more details on what you would like to do differently than the core code, we can help you figure out what changes to make.
Thanks,
Joe
Shooting from the hip, take a look at this tutorial on how to create a controller. Generally, what you'll be doing here is to create an action that will receive your form post, then execute whatever code you need.
So you'll be defining
http://mystore.com/somecontroller/something
by creatingMyModule_controllers_Somecontroller
with a method calledsomethingAction
. With some more detail, I can find you more specific examples.