PHPackages                             symplify/latte-to-twig-converter - 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. symplify/latte-to-twig-converter

Abandoned → [https://github.com/nette/latte-tools](/?search=https%3A%2F%2Fgithub.com%2Fnette%2Flatte-tools)ArchivedLibrary[Templating &amp; Views](/categories/templating)

symplify/latte-to-twig-converter
================================

Latte to Twig converter converts Latte to Twig

9.4.24(4y ago)49.9kMITPHPPHP &gt;=8.0

Since Jan 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/deprecated-packages/latte-to-twig-converter-next)[ Packagist](https://packagist.org/packages/symplify/latte-to-twig-converter)[ RSS](/packages/symplify-latte-to-twig-converter/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (7)Versions (218)Used By (0)

Latte to Twig Converter
=======================

[](#latte-to-twig-converter)

[![Downloads total](https://camo.githubusercontent.com/6b8a0734a6ee16a20ebacb1894a31e40fe207d67190eb419250a3fc5bd3be35f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796d706c6966792f6c617474652d746f2d747769672d636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/symplify/latte-to-twig-converter/stats)

Do you want to turn your [Latte](https://latte.nette.org/en/) templates to [Twig](https://twig.symfony.com/)?

**Before**

```
{foreach $values as $key => $value}
    {$value->getName()}

    {if isset($value['position'])}
        {$value['position']|noescape}
    {else}
        {var $noPosition = true}
    {/if}
{/foreach}
```

**After**

```
{% for key, value in values %}
    {{ value.getName() }}

    {% if value.position is defined %}
        {{ value.position|raw }}
    {% else %}
        {% set noPosition = true %}
    {% endif %}
{% endfor %}
```

And much more!

This package won't do it all for you, but **it will help you with 80 % of the boring work**.

Install
-------

[](#install)

```
composer require symplify/latte-to-twig-converter --dev
```

Usage
-----

[](#usage)

It scan all the `*.twig`/`*.latte` files and converts to Twig with `*.twig`.

```
vendor/bin/latte-to-twig convert file.twig
vendor/bin/latte-to-twig convert /directory
```

Handle These Cases to Manually
------------------------------

[](#handle-these-cases-to-manually)

Some code doesn't have a clear path - you have more options in Twig, so better to migrate it manually.

### `continueIf`

[](#continueif)

```
-{continueIf $cond}
+{% if cond %}
-{$value}
+    {{ value }}
+{% endif %}
```

### `breakIf`

[](#breakif)

```
-{breakIf $cond}
+{% if cond === false %}
-{$value}
+    {{ value }}
+{% endif %}
```

That's it :)

Report Issues
-------------

[](#report-issues)

In case you are experiencing a bug or want to request a new feature head over to the [Symplify monorepo issue tracker](https://github.com/symplify/symplify/issues)

Contribute
----------

[](#contribute)

The sources of this package are contained in the Symplify monorepo. We welcome contributions for this package on [symplify/symplify](https://github.com/symplify/symplify).

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 66.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 ~2 days

Total

217

Last Release

1793d ago

Major Versions

0.4.2 → 9.0.0-BETA22020-11-22

PHP version history (5 changes)v0.0.1PHP ^7.2

v0.3.32PHP ^7.2|^8.0

0.3.34PHP &gt;=7.2

9.0.0-rc1PHP &gt;=7.3

v9.3.27PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/924196?v=4)[Tomas Votruba](/maintainers/TomasVotruba)[@TomasVotruba](https://github.com/TomasVotruba)

---

Top Contributors

[![actions-user](https://avatars.githubusercontent.com/u/65916846?v=4)](https://github.com/actions-user "actions-user (85 commits)")[![TomasVotruba](https://avatars.githubusercontent.com/u/924196?v=4)](https://github.com/TomasVotruba "TomasVotruba (39 commits)")[![rector-bot](https://avatars.githubusercontent.com/u/291251500?v=4)](https://github.com/rector-bot "rector-bot (3 commits)")

---

Tags

instant-migrationlattemigrationphptwig

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/symplify-latte-to-twig-converter/health.svg)

```
[![Health](https://phpackages.com/badges/symplify-latte-to-twig-converter/health.svg)](https://phpackages.com/packages/symplify-latte-to-twig-converter)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k45](/packages/friendsoftypo3-content-blocks)

PHPackages © 2026

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