Download Latest Version Released version 3.1.6 source code.zip (228.9 kB)
Email in envelope

Get an email when there's a new version of Latte

Home / v3.1.3
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2026-03-22 1.5 kB
Released version 3.1.3 source code.tar.gz 2026-03-22 113.5 kB
Released version 3.1.3 source code.zip 2026-03-22 218.2 kB
Totals: 3 Items   333.1 kB 0

Latte 3.1.3 brings two powerful new engine features – automatic dedentation and scoped loop variables – alongside a fresh batch of filters that make everyday template work smoother.

✨ New Features

  • Feature::Dedent – removes structural indentation from paired tag content, so your generated HTML stays clean regardless of how deeply you nest your Latte tags
  • Feature::ScopedLoopVariables – variables introduced by {foreach} now live only inside the loop body, preventing accidental leaks into the surrounding scope (supports destructuring via ListNode too)
  • |commas filter – joins array elements with , and supports a custom last-item glue (e.g. {$items|commas:' and '}a, b and c)
  • |column filter – extracts values from a single column of a multidimensional array or iterable, mirroring PHP's array_column()
  • |limit filter – a friendlier wrapper around |slice with swapped arguments: limit first, offset second, and keys preserved by default
  • |slice – now works with iterators, not just arrays and strings
  • |padLeft, |padRight – now accept int|float values in addition to strings (#408)

♻️ Code Refactoring

  • Helpers::sortBeforeAfter() – reimplemented using Kahn's algorithm for topological sorting, making extension ordering both faster and more correct
  • Engine::addDefaultExtensions() – extracted into its own method for better extensibility
Source: README.md, updated 2026-03-22