Mustache (template system)

Mustache (template system)

Mustache is a simple web template system with language bindings available for ActionScript, C++, Clojure, CoffeeScript, ColdFusion, D, Erlang, Fantom, Go, Java, JavaScript, Lua, .NET, Objective-C, Perl, PHP, Python, Ruby and Scala. Syntax highlighting is available in Vim, Emacs, TextMate and Coda.

The Mustache templates support is built in into many Web application frameworks. The support in JavaScript includes both client-side programming with many popular JavaScript libraries and Ajax frameworks like jQuery, Dojo and YUI, as well as server-side JavaScript using Node.js and CommonJS.

Mustache is described as a "logic-less" system because it lacks any explicit control flow statements, like if and else conditionals or for loops, however both looping and conditional evaluation can be achieved using section tags processing lists and lambdas.

It is named "Mustache" because of heavy use of curly braces that resemble mustache.

Examples

The simplest template:

Hello {{name}}

Template with section tag:

{{#x}}
some text
{{/x}}

Here when x is a Boolean value then the section tag acts like an if conditional, but when x is an array then it acts like a foreach loop.

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Moustache (disambiguation) — A Moustache is a type of facial hair grown on the upper lip. Moustache can also refer to: Mustasch, a rock group from Sweden La Moustache, a 2005 French film Moustache, a music album by British band Farrah Moustache (dog), a French dog said to… …   Wikipedia

  • Lucky Luciano — Charles Luciano 1936 New York Police Department mugshot of Lucky Luciano Born Salvatore Lucania November 24, 1897(1897 11 24) Lercara Friddi, Sicily, Italy …   Wikipedia

  • Get a Mac — Mac vs. PC redirects here. For a comparison between operating systems, see comparison of operating systems. John Hodgman as PC and Justin Long as Mac. The Get a Mac campaign is a television advertising campaign created for Apple Inc. by TBWAMedia …   Wikipedia

  • Donkey Kong (video game) — Donkey Kong NES Box art Developer(s) Nintendo Publisher(s) …   Wikipedia

  • Colombo crime family — Boss Carmine Persico, currently serving life in prison In New York City, USA Founded by Joseph Profaci, named after Joseph Colombo, Sr …   Wikipedia

  • Mario Gigante — NYPD mugshot of Mario Gigante Mario Gigante (born November 4, 1923 Greenwich Village, Manhattan) is a New York City mobster who served as caporegime for the Genovese crime family. He is the older brother of late family boss Vincent The Chin… …   Wikipedia

  • John Gotti — For his son, see John A. Gotti. For the leader of the Maccabee revolt, see John Gaddi. Teflon Don redirects here. For Rick Ross album, see Teflon Don (album). John Gotti …   Wikipedia

  • Joseph D. Pistone — Donnie Brasco redirects here. For the 1997 crime drama film, see Donnie Brasco (film). Joseph D. Pistone FBI surveillance photo of Donnie Brasco Retired Federal Bureau of Investigation …   Wikipedia

  • Anthony Gaggi — Born August 7, 1925(1925 08 07) Manhattan, New York, U.S. Died April 17, 1988 …   Wikipedia

  • CouchDB — Apache CouchDB Administrationsoberfläche Futon …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”