我有一个自定义模块,它带有一个几乎不需要操作的控制器。例如:testAction,indexAction等等。
我可以使用访问indexAction
www.example.com/module/controller/
或
www.example.com/module/controller/index
但所有其他操作,例如(www.example.com/module/controller/test)返回404找不到页面。
有趣的是,当我更改Magento数据库时,一切都正常(我可以访问所有操作),而不会更改代码(我有两个数据库,它可以通过测试,但无法通过实时测试)。
在主题布局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();
}