yireo/magento2-hyva-theme-auto-registration
Composer 安装命令:
composer require yireo/magento2-hyva-theme-auto-registration
包简介
Automatically include modules in the Hyvä Theme registration
README 文档
README
Magento 2 module to make it easier to register a custom tailwind.config.js file of your own module in the global Hyvä Themes Tailwind configuration
Background
Hyvä Themes offers a Magento 2 CLI command hyva:config:generate to allow building a file app/etc/hyva-themes.json that again is used in modern-day Tailwind configuration of Hyvä-based themes. However, to extend this, one must add a custom observer to the module, which leads to a lot of code duplication across your modules. This module aims to simplify this. It offers an observer following the official Hyvä documentation.
However, this observer automatically registers any module that has a prefix Yireo_ or YireoTraining_ (it works for me). And it allows for extending things with a DI plugin.
Usage
Add this module as a dependency to your composer.json file and etc/module.xml file.
Next, add the following DI configuration to your module its etc/di.xml file (assuming here that Foo_Bar is the name of your own module):
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Yireo\HyvaThemeAutoRegistration\Observer\RegisterModuleForHyvaConfig"> <arguments> <argument name="moduleNames" xsi:type="array"> <item name="Foo_Bar" xsi:type="string">Foo_Bar</item> </argument> </arguments> </type> </config>
Alternatively, you can include all your modules by configuring a module prefix:
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Yireo\HyvaThemeAutoRegistration\Observer\RegisterModuleForHyvaConfig"> <arguments> <argument name="modulePrefixes" xsi:type="array"> <item name="Foo_" xsi:type="string">Foo_</item> </argument> </arguments> </type> </config>
yireo/magento2-hyva-theme-auto-registration 适用场景与选型建议
yireo/magento2-hyva-theme-auto-registration 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.72k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 10 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 yireo/magento2-hyva-theme-auto-registration 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 yireo/magento2-hyva-theme-auto-registration 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 13.72k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: OSL-3.0
- 更新时间: 2024-10-03