Magento 2 Clean Admin Menu 扩展教程

Magento 2 Clean Admin Menu 扩展教程

clean-admin-menuMagento 2 Extension to cleanup admin menu and Store > Configuration area by arranging third party extension items.项目地址:https://gitcode.com/gh_mirrors/cl/clean-admin-menu

1. 项目的目录结构及介绍

clean-admin-menu/
├── etc/
│   ├── adminhtml/
│   │   └── menu.xml
│   ├── module.xml
│   └── registration.php
├── LICENSE
├── README.md
├── composer.json
└── view/
    └── adminhtml/
        └── layout/
            └── adminhtml_system_config_edit.xml
  • etc/: 包含模块的配置文件。
    • adminhtml/menu.xml: 定义后台菜单的结构。
    • module.xml: 定义模块的基本信息。
    • registration.php: 注册模块。
  • LICENSE: 项目的许可证文件。
  • README.md: 项目的说明文档。
  • composer.json: Composer 配置文件。
  • view/adminhtml/: 包含后台视图的布局文件。
    • layout/adminhtml_system_config_edit.xml: 定义系统配置页面的布局。

2. 项目的启动文件介绍

项目的启动文件主要是 registration.php,它用于在 Magento 2 系统中注册该模块。

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'RedChamps_CleanAdminMenu',
    __DIR__
);

这个文件告诉 Magento 2 系统 RedChamps_CleanAdminMenu 模块的位置,并将其注册到系统中。

3. 项目的配置文件介绍

composer.json

composer.json 文件定义了模块的依赖关系、版本信息和其他元数据。

{
    "name": "redchamps/module-clean-admin-menu",
    "description": "Magento 2 Extension to cleanup admin menu and Store > Configuration area by arranging third party extension items",
    "require": {
        "php": "~7.1.3||~7.2.0||~7.3.0||~7.4.0",
        "magento/framework": "102.0.*",
        "magento/module-config": "101.0.*",
        "magento/module-backend": "101.0.*",
        "magento/module-store": "101.0.*",
        "magento/module-indexer": "101.0.*"
    },
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "MIT"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "RedChamps\\CleanAdminMenu\\": ""
        }
    }
}

module.xml

module.xml 文件定义了模块的基本信息和依赖关系。

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="RedChamps_CleanAdminMenu" setup_version="1.0.0"/>
</config>

menu.xml

menu.xml 文件定义了后台菜单的结构,将第三方扩展的菜单项合并到一个名为 "Extensions" 的菜单项下。

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="RedChamps_CleanAdminMenu::extensions" title="Extensions" module="RedChamps_CleanAdminMenu" sortOrder="10" resource="RedChamps_CleanAdminMenu::extensions"/>
        <add id="RedChamps_CleanAdminMenu::extensions_submenu" title="Extensions" module="RedChamps_CleanAdminMenu" sortOrder="10" parent="RedChamps_CleanAdminMenu::extensions" action="adminhtml/system_config/edit/section/extensions" resource="RedChamps_CleanAdminMenu::extensions

clean-admin-menuMagento 2 Extension to cleanup admin menu and Store > Configuration area by arranging third party extension items.项目地址:https://gitcode.com/gh_mirrors/cl/clean-admin-menu

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柏廷章Berta

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值