我正在学习Magento Admin菜单的开发。我正在尝试在Magento管理面板中开发一个简单的菜单。我的代码如下
文件位置:app/etc/modules/Alanstordotcom_Helloworld.xml
<?xml version="1.0" encoding="utf-8"?>
<config>
<modules>
<Alanstormdotcom_Helloworld>
<active>true</active>
<codePool>local</codePool>
</Alanstormdotcom_Helloworld>
</modules>
</config>
文件位置:app/code/local/Pulsestorm/Adminhello/etc/adminhtml.xml
<?xml version="1.0"?>
<config>
<menu>
<pulsestorm translate="title" module="pulsestorm_adminhello">
<title>Pulse Storm</title>
<sort_order>1</sort_order>
<children>
<example>
<title>Example</title>
<sort_order>1</sort_order>
<action>adminhtml/adminhello/index</action>
</example>
</children>
</pulsestorm>
</menu>
</config>
文件位置:app/code/local/Pulsestorm/Adminhello/etc/config.xml
<?xml version="1.0"?>
<config>
<config>
<modules>
<Alanstormdotcom_Helloworld>
<version>0.1.0</version>
</Alanstormdotcom_Helloworld>
</modules>
</config>
<global>
<helpers>
<pulsestorm_adminhello>
<class>Pulsestorm_Adminhello_Helper</class>
</pulsestorm_adminhello>
</helpers>
</global>
</config>
文件位置:app/code/local/Pulsestorm/Adminhello/Helper/Data.php
<?php
class Pulsestorm_Adminhello_Helper_Data extends Mage_Core_Helper_Abstract
{
}
但我在管理面板上看不到任何菜单。这里有什么问题??感谢
您将两个模块混合在一个模块中。您的config.xml
错误。
应该是
<?xml version="1.0"?>
<config>
<modules>
<Pulsestorm_Adminhello>
<version>1.0.0</version>
</Pulsestorm_Adminhello>
</modules>
<admin>
<routers>
<adminhtml>
<args>
<modules>
<Pulsestorm_Adminhello after="Mage_Adminhtml">Pulsestorm_Adminhello</Pulsestorm_Adminhello>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<global>
<helpers>
<pulsestorm_adminhello>
<class>Pulsestorm_Adminhello_Helper</class>
</pulsestorm_adminhello>
</helpers>
</global>
</config>
并且app/etc/modules/Alanstormdotcom_Helloworld
应该是app/etc/modules/Alanstormdotcom_Helloworld.xml
<?xml version="1.0"?>
<config>
<modules>
<Pulsestorm_Adminhello>
<active>true</active>
<codePool>local</codePool>
<depends></depends>
</Pulsestorm_Adminhello>
</modules>
</config>
您可以从alanstorm.com 下载此模块