定制 hyva-themes/module-magento2-admin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hyva-themes/module-magento2-admin

Composer 安装命令:

composer require hyva-themes/module-magento2-admin

包简介

This module aims to make creating grids and forms in the Magento 2 adminhtml area for developers joyful and fast

README 文档

README

This module aims to make creating grids and forms in the Magento 2 adminhtml area joyful and fast.
It does not use any UI components. Status: main branch tests

They came round the corner, and there was Eeyore's house, looking as comfy as anything.
"There you are," said Piglet.
"Inside as well as outside," said Pooh proudly.
Eeyore went inside . . . and came out again.
"It's a remarkable thing," he said. "It is my house, and I built it where I said I did, so the wind must have blown it here. And the wind blew it right over the wood, and blew it down here, and here it is as good as ever. In fact, better in places."
"Much better," said Pooh and Piglet together.
"It just shows what can be done by taking a little trouble," said Eeyore. "Do you see, Pooh? Do you see, Piglet? Brains first and then Hard Work. Look at it! That's the way to build a house," said Eeyore proudly.

  • Alan Alexander Miln, "The house at Pooh Corner"

Overview

Hyva_Admin is a Magento 2 module that offers a new way to create admin grids.
All existing grids and forms are not affected. They remain unchanged.
Hyva_Admin exists to improve the developer experience while creating new grids.

In the future, Hyva_Admin will support creating forms, too (this issue tracks progress).

Relationship with frontend Hyvä-Themes

This module does not require using a Hyva-Theme for a store front. It is an independent module. It only shares three things with the Hyvä frontend theme:

  • the idea that development should be enjoyable
  • the framework should support developers instead of creating more work than necessary
  • it uses tailwind css and alpinejs under the hood, but you will probably never even notice when using Hyva_Admin

You can install this module and enjoy it without having a Hyvä-Themes license. That said, I really recommend you get a store front Hyvä license, and make work there enjoyable and fast, too.

Rationale

When using the Magento 2 UI Components to create admin grids and forms, I always felt like I was dying a bit inside. From my point of view it's an awful system for a number of reasons that I don't want to go into more details about here. Alternative store fronts that do not use UI components (PWA Studio, Hyva Themes) are great for frontend developers, but (un?)fortunately I mostly do backend work. The UI interfaces I create are mostly for store owners and admins.

I desire a way to do my job (which includes building grids and forms) that doesn't feel like I have to fight the framework.
I want to feel empowered and get work done quickly and efficiently. After years of bitching about Magento, I was very impressed by the work Willem Wigman has done with the Hyvä frontend theme. He inspired me to stop complaining and also take matters into my own hands, and finally build the tools I desire. Hence, Hyva_Admin.

Installation

The module can be installed via composer by adding the repository as a source and then requiring it:

composer require hyva-themes/module-magento2-admin

If you want to just play around to get a feel for Hyva_Admin grids, you can install a test module that declares an example grid, too:

composer require hyva-themes/module-magento2-admin-test

Requirements

It should work with pretty much any Magento 2 version, as long as the $escaper is assigned in templates.

Quickstart

Note: Both an overview with a step by step walkthrough and an API reference can be found in the docs folder.

Once installed, grids can be added to any admin page by adding a bit of layout XML and a grid configuration file.
The layout XML has to contain two things:

  • A <update handle="hyva_admin_grid"/> declaration to load alpine.js and tailwind.
  • A Hyva\Admin\Block\Adminhtml\HyvaGrid block, with name of the grid configuration as a block argument (or as the block name-in-layout).

After that, a grid configuration has to be created in a directory [Your_Module]/view/adminhtml/hyva-grid, where the file names corresponds to the name that was passed to the grid block (with a .xml suffix added to the file name).

The grid configuration will need contain a grid source specification. Currently that can be a repository list method, or a \Hyva\Admin\Api\HyvaGridArrayProviderInterface implementation.

With no further configuration, all fields of the provided records are shown as grid columns. It's then possible to either exclude columns as needed, or, alternatively, specify an include-list for the columns to display. In many cases the default will be good enough and no further configuration beyond the grid source will be necessary.

Grid row actions, mass actions, paging and filtering can also be configured as needed.

More information can be found in the Hyva Admin documentation.

Stability

The module isn’t feature complete. However, the API will remain stable, unless some real flaw is discovered.
New features will be added in a backward compatible manner.

Contributions

PR's are very welcome.
Please submit contributions based on the main branch. Currently, the oldest supported PHP version is 7.4.

License

This package is licensed under the Open Software License (OSL 3.0).

  • Copyright: Copyright © 2020-present Hyvä Themes. All rights reserved.
  • License Text (OSL 3.0): The full text of the OSL 3.0 license can be found in the LICENSE.txt file within this package, and is also available online at http://opensource.org/licenses/osl-3.0.php.

Parting words

"And I know it seems easy," said Piglet to himself,
"but it isn't every one who could do it."

  • Alan Alexander Miln, "The house at Pooh Corner"

hyva-themes/module-magento2-admin 适用场景与选型建议

hyva-themes/module-magento2-admin 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 378.02k 次下载、GitHub Stars 达 176, 最近一次更新时间为 2020 年 12 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 hyva-themes/module-magento2-admin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hyva-themes/module-magento2-admin 我们能提供哪些服务?
定制开发 / 二次开发

基于 hyva-themes/module-magento2-admin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 378.02k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 176
  • 点击次数: 19
  • 依赖项目数: 13
  • 推荐数: 0

GitHub 信息

  • Stars: 176
  • Watchers: 13
  • Forks: 43
  • 开发语言: CSS

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2020-12-30