定制 artack/svg-inline-bundle 二次开发

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

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

artack/svg-inline-bundle

最新稳定版本:1.2.0

Composer 安装命令:

composer require artack/svg-inline-bundle

包简介

README 文档

README

Twig function to embed svg files as inline svg code into your html code.

Latest Release MIT License Total Downloads

Developed by artack in Zurich, Switzerland.

Features

  • Provides twig function to embed svg files as inline svg code into your html code
  • Compatible with PHP >= 8.1.
  • Compatible with Symfony >= 6.1 (including 7).

Installation

You can install this bundle through Composer:

$ composer require artack/svg-inline-bundle

Configuration

Register the bundle in your config/bundles.php file.

return [
    ...
    Artack\SvgInlineBundle\SvgInlineBundle::class => ['all' => true],
    ...
];

Create the configuration file in your config/packages/artack_svg_inline.yaml to define the base path for the svg files.

svg_inline:
    path: "%kernel.project_dir%/assets/ci/icon"

Usage

Load a svg file as inline svg code into your html code:

# some/template.html.twig
{{ svg_inline('twitter.svg') }}

If you want to add classes to the svg tag you can use the class parameter:

# some/template.html.twig
{{ svg_inline('twitter.svg', class: 'add as many classes as you want') }}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-23