我试图为 magento 管理部分创建一个新模块。我看过很多关于这个问题的话题,但没有一个能解决我的问题。
我在 app/etc/modules/ 中创建了一个名为 Company_CustomList.xml 的文件
<?xml version="1.0"?>
<config>
<modules>
<Company_CustomList>
<active>true</active>
<codePool>local</codePool>
</Company_CustomList>
</modules>
</config>
然后在 app/code/local/Company/CustomList 我创建了以下文件:
app/code/local/Company/CustomList/Block/List.php
<?php
class Company_CustomList_Block_List extends Mage_Core_Block_Template
{
// necessary methods
}
?>
应用程序/代码/本地/公司/控制器/Adminhtml/IndexController.php
<?php
class Company_CustomList_Adminhtml_IndexController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
?>
应用程序/代码/本地/公司/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<Company_CustomList>
<version>0.1.0</version>
</Company_CustomList>
</modules>
<adminhtml>
<acl>
<resources>
<admin>
<children>
<customlist>
<title>Custom list</title>
<children>
<example translate="title" module="customlist">
<title>Index</title>
</example>
</children>
</customlist>
</children>
</admin>
</resources>
</acl>
</adminhtml>
<global>
<helpers>
<customlist>
<class>Company_CustomList_Helper</class>
</customlist>
</helpers>
</global>
</config>
应用程序/代码/本地/公司/etc/adminhtml.xml
<?xml version="1.0"?>
<config>
<menu>
<customlist translate="title" module="customlist">
<title>Custom list</title>
<sort_order>15</sort_order>
<children>
<example translate="title" module="customlist">
<title>Index</title>
<sort_order>1</sort_order>
<action>adminhtml/customlist/index</action>
</example>
</children>
</customlist>
</menu>
<acl>
<resources>
<admin>
<children>
<customlist translate="title" module="customlist">
<title>Custom list</title>
<sort_order>15</sort_order>
<children>
<example translate="title" module="customlist">
<title>Index</title>
<sort_order>1</sort_order>
<action>adminhtml/customlist/index</action>
</example>
</children>
</customlist>
</children>
</admin>
</resources>
</acl>
</config>
app/code/local/Company/Helper/Data.php
<?php
class Company_CustomList_Helper_Data extends Mage_Core_Helper_Abstract {
}
?>
问题可能来自我的 ACL ......但我真的找不到如何解决它。
谢谢,