12. Magento 后台top栏开发

  1. 新建模块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
{

}

这里写图片描述
这里写图片描述
这里写图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值