【问题标题】:Magento controller: indexAction works but all other Actions return 404Magento 控制器:indexAction 有效,但所有其他操作返回 404
【发布时间】:2015-10-28 22:34:41
【问题描述】:

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

我可以使用 indexAction 访问

www.example.com/module/controller/

www.example.com/module/controller/index

但所有其他操作,例如(www.example.com/module/controller/test)返回 404 Page not found。

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

【问题讨论】:

    标签: php magento zend-framework magento-1.9


    【解决方案1】:

    在你的主题布局 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();
     }
    

    【讨论】:

      猜你喜欢
      • 2021-07-21
      • 2013-03-11
      • 2012-10-25
      • 2019-04-21
      • 1970-01-01
      • 2014-08-14
      • 2018-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多