PHPackages                             mangoweb/latte-bundle - 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. mangoweb/latte-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

mangoweb/latte-bundle
=====================

Latte templating engine for Symfony

v1.1.0(5y ago)8301MITPHPPHP ^7.1|^8.0

Since Feb 12Pushed 5y ago4 watchersCompare

[ Source](https://github.com/mangoweb-backend/latte-bundle)[ Packagist](https://packagist.org/packages/mangoweb/latte-bundle)[ RSS](/packages/mangoweb-latte-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

Latte for Symfony
=================

[](#latte-for-symfony)

How to install
--------------

[](#how-to-install)

- Just install it as standard symfony bundle
- Then just ask for `Latte\Engine` service

Latte
-----

[](#latte)

- See

### Symfony specific macros

[](#symfony-specific-macros)

#### renderRoute

[](#renderroute)

Makes a request to the given route and prints the result.

##### Spec

[](#spec)

```
{renderRoute [, 'routeParams'=>[( => ,)...][, 'renderOptions'=>[( => ,)...]}

```

##### Example

[](#example)

```
{renderRoute myAwesomeRoute,'routeParams'=>['x' => 5, 'y' => 7],'renderOptions'=>['strategy' => 'inline']}
```

#### routePath

[](#routepath)

Print the relative URL (without the scheme and host) for the given route.

##### Spec

[](#spec-1)

```
{routePath [, => ]...}

```

```

```

##### Example

[](#example-1)

```
{routePath myAwesomeRoute,'x' => 5,'y' => 7}
```

```

```

#### routeUrl

[](#routeurl)

Print the absolute URL (with scheme and host) for the given route.

##### Spec

[](#spec-2)

```
{routeUrl [, => ]...}

```

##### Example

[](#example-2)

```
{routeUrl myAwesomeRoute,'x' => 5,'y' => 7}
```

#### relativePath

[](#relativepath)

Returns the relative path from the passed absolute URL. See [Symfony doc - relative\_path](http://symfony.com/doc/current/reference/twig_reference.html#relative-path)

##### Spec

[](#spec-3)

```
{relativePath }

```

##### Example

[](#example-3)

```
{relativePath 'http://example.com/human.txt'}
```

#### absoluteUrl

[](#absoluteurl)

Returns the absolute URL from the passed relative path.

##### Spec

[](#spec-4)

```
{absoluteUrl }

```

##### Example

[](#example-4)

```
{absoluteUrl 'human.txt'}
```

#### csrfToken

[](#csrftoken)

Renders a CSRF token. Use this function if you want CSRF protection without creating a form.

See [Symfony doc - csrf\_token](http://symfony.com/doc/current/reference/twig_reference.html#csrf-token)

##### Spec

[](#spec-5)

```
{csrfToken }

```

#### logoutUrl - logoutPath

[](#logouturl---logoutpath)

Generates a absolute/relative logout URL for the given firewall. If no key is provided, the URL is generated for the current firewall the user is logged into.

##### Spec

[](#spec-6)

```
{logoutPath [key]}
{logoutUrl [key]}

```

### Symfony filters

[](#symfony-filters)

#### translate

[](#translate)

See [Symfony docs - translation in templates](http://symfony.com/doc/current/translation.html#translations-in-templates)

##### Spec

[](#spec-7)

```
{=""|translate[:[( => ,)...]][:][:]}
{_""}

```

- `domain` - string, optional
- `locale` - string, optional

##### Example

[](#example-5)

```
{="my.awesome.translation.key"|translate:['%name%' => 'Karel','%job%' => 'Metař']}
{="my.awesome.translation.key"}
```

#### translateChoice

[](#translatechoice)

See [Symfony docs - translation in templates](http://symfony.com/doc/current/translation.html#translations-in-templates)

##### Spec

[](#spec-8)

```
{=""|translateChoice:[:[( => ,)...]][:][:]}

```

- `count` - int, required
- `domain` - string, optional
- `locale` - string, optional

##### Example

[](#example-6)

```
{="my.awesome.translation.key"|translateChoice:5:['%name%' => 'Karel','%job%' => 'Metař']}
```

How to expand
-------------

[](#how-to-expand)

### Macros

[](#macros)

#### Simple macro

[](#simple-macro)

- Class [`\Mangoweb\LatteBundle\Macro\SimpleMacro`](/src/Macro/SimpleMacro.php) is wrapper for macroSet-&gt;addMacro() (see )
- Extend class and mark service with service tag `- { name: latte.simple_macro }`
- Or Implement [`\Mangoweb\LatteBundle\Macro\ISimpleMacroProvider`](/src/Macro/ISimpleMacroProvider.php)and mark it with service tag `- { name: latte.simple_macro_provider }`

#### Advanced macro

[](#advanced-macro)

- Implement directly `\Latte\IMacro`
- Register service and mark it with service tag `- { name: latte.advanced_macro, macro_name: fooBar }`

### Filters

[](#filters)

#### Filter provider

[](#filter-provider)

- Implement [`\Mangoweb\LatteBundle\Filter\IFilterProvider`](/src/Filter/IFilterProvider.php)
- Mark service with service tags: `{name: 'latte.filter_provider'}`

### Providers

[](#providers)

- Create service and tag it with `- {name: 'latte.provider', provider_name: fooBar }`
- This will then be avabile at runtime in latte via `$this->global->fooBar`

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~328 days

Total

2

Last Release

1952d ago

PHP version history (2 changes)v1.0.0PHP ~7.1

v1.1.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6163a0eec16c2bfc9cce0c7c8801b5166cca9af81a146764676059a965044000?d=identicon)[JanTvrdik](/maintainers/JanTvrdik)

---

Top Contributors

[![JanTvrdik](https://avatars.githubusercontent.com/u/175109?v=4)](https://github.com/JanTvrdik "JanTvrdik (4 commits)")[![michalhosna](https://avatars.githubusercontent.com/u/679759?v=4)](https://github.com/michalhosna "michalhosna (2 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mangoweb-latte-bundle/health.svg)

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

###  Alternatives

[friendsofsymfony/ckeditor-bundle

Provides a CKEditor integration for your Symfony project.

53014.3M49](/packages/friendsofsymfony-ckeditor-bundle)[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)[webrouse/n-asset-macro

Asset macro for Latte and Nette Framework useful for assets cache busting (with gulp, webpack, etc.)

1264.4k1](/packages/webrouse-n-asset-macro)[craue/formflow-demo-bundle

Example code showcasing the features of CraueFormFlowBundle.

298.5k](/packages/craue-formflow-demo-bundle)

PHPackages © 2026

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