- 新建模块Www/First
confi.xml
<config>
<global>
<helpers>
<first>
<class>Www_First_Helper</class>
</first>
</helpers>
</global>
<admin>
<routers>
<first>
<use>admin</use>
<args>
<module>Www_First</module>
<frontName>first</frontName>
</args>
</first>
</routers>
</admin>
<adminhtml>
<menu>
<first>
<title>first</title>
<sort_order>999</sort_order>
<children>
<media translate="title" module="first">
<title>caidan1</title>
<action>first/hello/index</action>
</media>
<media1 translate="title" module="first">
<title>caidan2</title>
<action>first/hello/test</action>
</media1>
</children>
</first>
</menu>
</adminhtml>
</config>
<adminhtml>为配置后台模板
<menu>为TOP栏菜单
<title>为菜单名称
<childern>为子菜单
<action> 为URL:first/hello/test
URL第一项是模块名,第二项是控制器名,第三项是action名
这样,后台的项目URL就和Www_First模块对应
HelloController.php
<?php
class Www_First_HelloController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
echo "caidan1111";
}
public function testAction()
{
echo 'caidan2222';
}
}
Data.php
<?php
class Www_First_Helper_Data extends Mage_Core_Helper_Abstract
{
}