aimanecouissi/module-hyva-boxicons 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

aimanecouissi/module-hyva-boxicons

最新稳定版本:1.0.0

Composer 安装命令:

composer require aimanecouissi/module-hyva-boxicons

包简介

Add the Boxicons SVG icon set to Hyvä Themes

README 文档

README

Latest Stable Version Total Downloads Magento Version License PHP Version Require Hyvä Compatible

Integrates the Boxicons free SVG icon set into Hyvä Themes, exposing basic, filled, and brands styles as dedicated SvgIcons view models. Browse the included icons in the SVG directory or preview them at boxicons.com.

Note

This module only includes the free Boxicons set.

Installation

composer require aimanecouissi/module-hyva-boxicons
bin/magento module:enable AimaneCouissi_HyvaSvgIcons AimaneCouissi_HyvaBoxicons
bin/magento setup:upgrade
bin/magento cache:flush

Usage

In Hyvä PHTML templates

Require the view models for the styles you need and call their helper methods to render icons:

<?php

use AimaneCouissi\HyvaBoxicons\ViewModel\BoxiconsBasic;
use AimaneCouissi\HyvaBoxicons\ViewModel\BoxiconsBrands;
use AimaneCouissi\HyvaBoxicons\ViewModel\BoxiconsFilled;
use Hyva\Theme\Model\ViewModelRegistry;

/** @var ViewModelRegistry $viewModels */

$boxiconsBasic = $viewModels->require(BoxiconsBasic::class);
$boxiconsFilled = $viewModels->require(BoxiconsFilled::class);
$boxiconsBrands = $viewModels->require(BoxiconsBrands::class);
?>
<?= $boxiconsBasic->cartHtml('w-6 h-6', 24, 24, ['aria-label' => 'Cart']) ?>
<?= $boxiconsFilled->starHtml('w-5 h-5 text-yellow-400', 20, 20, ['aria-hidden' => 'true']) ?>
<?= $boxiconsBrands->instagramHtml('w-6 h-6', 24, 24, ['aria-label' => 'Instagram']) ?>

Methods are generated from SVG filenames and fully documented via PHPDoc on each view model, so your IDE can autocomplete them.

In CMS content

The module registers three icon prefixes for Hyvä SvgIcons: boxicons-basic, boxicons-filled, and boxicons-brands. Icons can be used directly in CMS pages, blocks, and widgets:

{{icon "boxicons-basic/cart" classes="inline-block w-6 h-6" width=24 height=24}}
{{icon "boxicons-filled/star" classes="inline-block w-5 h-5 text-yellow-400" width=20 height=20}}
{{icon "boxicons-brands/instagram" classes="inline-block w-6 h-6" width=24 height=24}}

Uninstall

bin/magento module:disable AimaneCouissi_HyvaBoxicons
composer remove aimanecouissi/module-hyva-boxicons
bin/magento setup:upgrade
bin/magento cache:flush

Changelog

See CHANGELOG for all recent changes, including icon set version updates.

License

The Boxicons SVG icons are created by Boxicons and licensed under CC BY 4.0.

Warning

Individual brand icons may be subject to their own trademark and usage guidelines. Trademark usage is the responsibility of the end user. Please consult individual brand guidelines before displaying logos in commercial contexts.

This module's source code is separately licensed under MIT.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-22