PHPackages                             dada-amater/latte-svg - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. dada-amater/latte-svg

ActiveLibrary[Templating &amp; Views](/categories/templating)

dada-amater/latte-svg
=====================

Latte macro to embed SVG from file into HTML

v1.4.1(3y ago)010.2k[1 issues](https://github.com/ScrumWorks/latte-svg/issues)MITPHPPHP &gt;=7.1.0

Since Jul 20Pushed 3y ago5 watchersCompare

[ Source](https://github.com/ScrumWorks/latte-svg)[ Packagist](https://packagist.org/packages/dada-amater/latte-svg)[ RSS](/packages/dada-amater-latte-svg/feed)WikiDiscussions master Synced yesterday

READMEChangelog (8)Dependencies (2)Versions (10)Used By (0)

Example init
============

[](#example-init)

```

    Publications
    {svgFallback icon-group}

```

Result HTML code IN IE may look like:

```

    Publications

        ... content of symbol-defs.svg file ...

```

Example of icon
===============

[](#example-of-icon)

```
{svg bin, some-class, icon-group}
```

Result HTML code IN IE may look like:

```

```

Result in Chrome, FF, Opera may look like:

```

```

Purpose
=======

[](#purpose)

This is a single purpose helper library with a macro definition for [Latte](https://latte.nette.org/), the PHP templating engine. It loads SVG source file and embed it into HTML code in compile time.

Motivation for this is possibility to stylize SVG by CSS then. It is not (easily) possible with SVG linked as an image like ``.

Installation
============

[](#installation)

Require library by [Composer](https://getcomposer.org/):

```
composer require dada-amater/latte-svg

```

Register extension in your `config.neon` and configure it:

```
extensions:
    latteSvg: DadaAmater\LatteSvg\Extension

latteSvg:
    baseDir: %wwwDir%
    wwwPathMask: 'images/svg/{group}/symbol-defs.svg'
    defaultGroup: base
    defaultIconClass: svg-icon
    iconNamePrefix: icon
```

Caveats &amp; Limitations
=========================

[](#caveats--limitations)

Because `svg` is a macro, it is compiled into PHP only once and then is cached. So, when you change the macro configuration, probably in NEON, you have to purge Latte cache.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~220 days

Recently: every ~378 days

Total

8

Last Release

1309d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c9c03fa0f366667308914e83550d9161ac85960a5ccfbfd79c90b776f86692d?d=identicon)[dada-amater](/maintainers/dada-amater)

---

Top Contributors

[![dada-amater](https://avatars.githubusercontent.com/u/3747040?v=4)](https://github.com/dada-amater "dada-amater (8 commits)")[![pepa-linha](https://avatars.githubusercontent.com/u/4296423?v=4)](https://github.com/pepa-linha "pepa-linha (1 commits)")

---

Tags

nettesvglattemacroembedded

### Embed Badge

![Health badge](/badges/dada-amater-latte-svg/health.svg)

```
[![Health](https://phpackages.com/badges/dada-amater-latte-svg/health.svg)](https://phpackages.com/packages/dada-amater-latte-svg)
```

###  Alternatives

[contributte/latte

Extra contrib to nette/latte

111.5M2](/packages/contributte-latte)[nepada/form-renderer

Latte template based form renderer for Nette forms with full support for Bootstrap 3, 4 &amp; 5.

11251.0k](/packages/nepada-form-renderer)[nextras/forms-rendering

Rendering helpers for Nette Framework Forms.

1698.4k2](/packages/nextras-forms-rendering)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
