webagil-kevin/twig-heroicons 问题修复 & 功能扩展

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

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

webagil-kevin/twig-heroicons

最新稳定版本:v2.1

Composer 安装命令:

composer require webagil-kevin/twig-heroicons

包简介

Unofficial Twig integration for Heroicons

README 文档

README

tests

This package provides an Heroicons integration for Twig.

Install

Use composer:

composer require webagil-kevin/twig-heroicons

Symfony

You do not need to do anything more to use the extension.

Twig

If you use Twig directly, register the extension before using it:

<?php

use Webagil\Heroicons\Twig\HeroiconsExtension;
use Twig\Environment;

$twig = new Environment(/* ... */);
$twig->addExtension(new HeroiconsExtension());

Usage

This extension provides a heroicon function that outputs the icon SVG.

{# function signature #}
{{ heroicon(icon, class, style) }}

{# the default style is 'solid' #}
{{ heroicon('academy-cap') }}

{# use the 'outline' style #}
{{ heroicon('academy-cap', '', 'outline') }}

{# Add a custom class to the SVG #}
{{ heroicon('academy-cap', 'text-green-200', 'outline') }}

4 types of icon styles : solid, outline, mini and micro.

License

This library is MIT licensed.

Acknowledgment

This project is a fork of the marcw/twig-heroicons repository.

The purpose for this fork is to update the project and maintain compatibility with the latest version of Symfony and Heroicons. We greatly appreciate the effort and work that went into the original project.

Please refer to the original repository for information on the original project.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-31