talira

Smarty (PHP)

The compiling template engine for PHP

open sourceLGPL-3.0-or-laterfree

Smarty is a template engine for PHP that keeps presentation (HTML and CSS) apart from application logic. Templates use variables, modifiers, functions and tags such as if, and Smarty compiles them; its docs cover template inheritance, caching, config files, filters, a debugging console and a security policy.

Problems it solves

  • keep HTML out of my PHP application code
  • let designers edit page templates without touching PHP
  • cache rendered PHP templates

Features

  • template variables, modifiers and functions
  • template inheritance
  • template caching
  • config files
  • debugging console
  • security policy for templates

Alternatives

The same job

These do what Smarty (PHP) does.

  1. Twig The flexible, fast, and secure template engine for PHP
  2. Latte PHP template engine with context-sensitive escaping

Compare Smarty (PHP) with the top 3