承接 jmf/twig-icon-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jmf/twig-icon-bundle

Composer 安装命令:

composer require jmf/twig-icon-bundle

包简介

Symfony bundle for rendering pre-set icons in Twig templates.

README 文档

README

Symfony bundle providing a Twig icon() function backed by a configurable icon ID-to-CSS-class mapping.

Requirements

  • PHP 8.3+
  • Symfony 7.0 or 8.0

Installation

Install with Composer:

composer require jmf/twig-icon-bundle

Register the bundle in config/bundles.php if not using Symfony Flex:

<?php

return [
    // ...
    Jmf\Twig\Extension\Icon\JmfTwigIconBundle::class => ['all' => true],
];

Quick Start

Create config/packages/jmf_twig_icon.yaml (example for a usage with Material Symbols):

jmf_twig_icon:
    mapping:
        back:       'arrow_back'
        bookmark:   'check_box_outline_blank'
        bookmarked: 'check_box'
        create:     'add'
        delete:     'delete'
        download:   'download'
        link:       'link'
        print:      'print'
        read:       'visibility'
        save:       'save'
        search:     'search'
        swap:       'swap_horiz'
        unlink:     'link_off'
        update:     'edit'
        user:       'person'
        warning:    'warning'
        zoom_in:    'zoom_in'

Then use in Twig:

{{ icon('back') }}

Configuration Reference

jmf_twig_icon:

    # Optional prefix before the "icon" function name. Default: ''
    # Example: 'jmf_' registers 'jmf_icon' instead of 'icon'.
    prefix: ''

    # Twig template used to render the icon. Default: '@JmfIcon/material/icon.html.twig'
    template_path: '@JmfIcon/material/icon.html.twig'

    # Map of icon IDs to their CSS class names.
    mapping:
        back:       'arrow_back'
        bookmark:   'check_box_outline_blank'
        bookmarked: 'check_box'
        create:     'add'
        delete:     'delete'
        download:   'download'

A sample configuration file is available in the samples/ directory.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2026-05-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固