artack/svg-inline-bundle

Installs: 16

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.1.1 2024-11-03 12:19 UTC

This package is auto-updated.

Last update: 2024-11-03 12:56:52 UTC


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') }}