Squirrelly
Get StartedTemplate SyntaxAPICommunity
7.x.x
7.x.x
  • Overview
  • FAQ
  • Demo
  • Performance
  • Changelog
  • Getting Started
    • Installation
    • Your First Template
    • Why Squirrelly?
    • What's a template engine?
  • Template Syntax
    • The Basics
    • Global References
    • Helper References
    • Filters
    • Helpers
    • Self-Closing Helpers
    • Native Helpers
    • Setting custom tags
    • Partials
    • Built-in Helpers
  • API
    • API Overview
    • Compile
    • Render
    • renderFile
    • load
    • defineFilter
    • setDefaultFilters
    • autoEscaping
    • defineHelper
    • defineNativeHelper
    • definePartial
    • defaultTags
  • Recipes
    • Squirrelly with ExpressJS
  • Guides
    • Generating Badges with Squirrelly
Powered by GitBook
On this page
  1. Getting Started

What's a template engine?

A template engine is a program that takes a template and data, and returns the template filled with the data.

Many template engines work by turning the template into a function where one of the parameters is the data. This function can be cached and saved, so the template engine doesn't need to re-parse the template again.

Example

var template = "My favorite template engine is {{engine}}"
Sqrl.Render(template, {engine: 'Squirrelly'})
// My favorite template engine is Squirrelly
Sqrl.Render(template, {engine: 'not Dust'})
// My favorite template engine is not Dust
PreviousWhy Squirrelly?NextThe Basics

Last updated 5 years ago