Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Svg Inline Bundle Laravel Package

artack/svg-inline-bundle

View on GitHub
Deep Wiki
Context7

artack/svg-inline-bundle

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

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
comsave/common
alecsammon/php-raml-parser
chrome-php/wrench
lendable/composer-license-checker
typhoon/reflection
mesilov/moneyphp-percentage
mike42/gfx-php
bookdown/themes
aura/view
aura/html
aura/cli
povils/phpmnd
nayjest/manipulator
omnipay/tests
psr-mock/http-message-implementation
psr-mock/http-factory-implementation
psr-mock/http-client-implementation
voku/email-check
voku/urlify
rtheunissen/guzzle-log-middleware