Magento控制器:indexAction有效但所有其他操作返回404

时间:2015-10-28 22:34:41

标签: php magento zend-framework magento-1.9

我有一个带有控制器的自定义模块,几乎没有操作。例如:testAction,indexAction等。

我可以使用

访问indexAction

www.example.com/module/controller /

www.example.com/module/controller/index

但所有其他操作例如。(www.example.com/module/controller/test)返回404页面未找到。

有趣的是,当我更改Magento数据库时,一切正常(我可以访问所有操作)而无需更改代码(我有两个数据库,它可以使用测试,但实时失败)。

1 个答案:

答案 0 :(得分:0)

在主题布局xml中尝试这个

<module_controller_action translate="label">
   <reference name="content">
      <block type="core/template" name="name" template="path/to/form.phtml"/>
   </reference>
</module_controller_action>

 public function testAction() {
    $this->loadLayout();
    $this->renderLayout();
 }