encyclopegia.org

Smarty (template engine)

Smarty is a web template system written in PHP.[src] Smarty is primarily promoted as a tool for separation of concerns, and is intended to simplify compartmentalization, allowing the front-end of a web page to change separately from its back-end.[src] Ideally, this lowers costs and minimizes the efforts associated with software maintenance.[src] Smarty generates web content through the placement of special Smarty tags within a document.[src] These tags are processed and substituted with other code.[src] Tags are directives for Smarty that are enclosed by template delimiters.[src] These directives can be variables, denoted by a dollar sign ($), functions, logical or loop statements.[src] Smarty allows PHP programmers to define custom functions that can be accessed using Smarty tags.[src]

Smarty is a web template system written in PHP.[src] Smarty is primarily promoted as a tool for separation of concerns, and is intended to simplify compartmentalization, allowing the front-end of a web page to change separately from its back-end.[src] Ideally, this lowers costs and minimizes the efforts associated with software maintenance.[src] Smarty generates web content through the placement of special Smarty tags within a document.[src] These tags are processed and substituted with other code.[src] Tags are directives for Smarty that are enclosed by template delimiters.[src] These directives can be variables, denoted by a dollar sign ($), functions, logical or loop statements.[src] Smarty allows PHP programmers to define custom functions that can be accessed using Smarty tags.[src] {$title_text|escape} {* This is a little comment that won't be visible in the HTML source *} {$body_html} The PHP business logic to use the Smarty template above could be: define('SMARTY_DIR', 'smarty-2.6.22/'); require_once(SMARTY_DIR .[src] 'Smarty.class.php'); $smarty = new Smarty(); $smarty->template_dir = './templates/'; $smarty->compile_dir = './templates/compile/'; $smarty->assign('title_text', 'TITLE: This is the Smarty basic example ...'); $smarty->assign('body_html', ' BODY: This is the message set using assign() '); $smarty->display('index.tpl'); ==Further reading== ==References== ==External links==[src]

18 sentences · 18 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Smarty (template engine)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/smarty-template-engine. Accessed 30 November 2026.

Chicago

"Smarty (template engine)." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/smarty-template-engine.

APA

encyclopegia.org. (2026). Smarty (template engine). Retrieved November 30, 2026, from https://encyclopegia.org/wiki/smarty-template-engine

Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1369491741 · 0.5 · snapshot enwiki-001369491741

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.