Magento模块管理控制器返回404错误

时间:2011-09-15 12:10:16

标签: magento

我正在按照tutorial创建简单的报告模块。当我尝试打开

  

http://localhost/dev/admin/adminhtml/report_example/simple

我收到404错误。任何帮助都会受到赞赏。这就是我做的事情

应用程序的/ etc /模块/ Package_Custom.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Package_Custom>
            <active>true</active>
            <codePool>local</codePool>
        </Package_Custom>
    </modules>
</config>

应用程序/代码/本地/包装/定制/控制器/ Adminhtml /报表/ ExampleController.php

<?php

class Package_Custom_Adminhtml_Report_ExampleController extends Mage_Adminhtml_Controller_Action
{
    public function _initAction()
    {
        $this->loadLayout()->_addBreadcrumb(Mage::helper('custom')->__('Custom'),Mage::helper('custom')->__('Custom'));
        return $this;
    }
}
?>

应用程序/代码/本地/包装/自定义的/ etc / adminhtml.xml

<?xml version="1.0"?>
<config>
    <menu>
        <custom translate="title" module="custom">
            <title>Custom</title>
            <sort_order>15</sort_order>
            <children>
                <simple translate="title" module="custom">
                    <title>Simple Report<</title>
                    <sort_order>1</sort_order>
                    <action>adminhtml/report_example/simple</action>
                </simple>
            </children>
        </custom>
    </menu>

应用程序/代码/本地/包装/自定义的/ etc / config.xml中

  <?xml version="1.0"?>
<config>
<modules>
        <Package_Custom>
            <version>1.0.0</version>
        </Package_Custom>
    </modules>
<admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <custom before="Mage_Adminhtml">Package_Custom_Adminhtml</custom>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>
</config>

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

解决了问题。在config.xml中

<title>Simple Report<</title>

应该是

<title>Simple Report</title>
相关问题