IT lexicon › Web › Template engine

Template engine

Web På svenska → Updated: 2026-07-29

A program that merges a template with data into finished text — usually HTML, but equally email, configuration files or SQL. Separates structure from content.

They all look roughly alike: placeholders for values, some form of repetition and conditionals, and a way to extract parts into partials or inherit from a base template. The difference lies in how much logic is permitted — Mustache forbids it almost entirely, Jinja and Twig allow expressions and filters, ERB and EJS let you run arbitrary code, which is convenient and ends badly. Autoescaping is the single most important property: an engine that escapes HTML by default removes an entire class of XSS bugs. Server-side rendering with a template engine is still faster for content pages than shipping JSON to a client that draws the same thing.

← Back to the lexicon