Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Ultra-Fast Logic Less Template For Delphi Applications Using Synopse DMustache

Mustache is a Logic-Less Templates by Chris Wanstrath. Mustache can be used for HTML, config files, source code – anything. It is called as “logic-less” because there there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values. It works by expanding tags in a template using values provided in a hash or object. DMustache is a Delphi implementation of the Mustache templating language by Arnaud Bouchez and others.

Features :

Version Supported : Delphi 6 up to Delphi 10.3.

License : This library is part of the Open Source mORMot framework, so is released under the same disjunctive tri-license giving you the choice of one of the three following sets of free software/open source licensing terms:

Sample Code :

  1. Create a Windows VCL Application. Add the Downloaded Synopse/Dmustache source from Github and add to the project.
  2. Include SynCommons, SynMustache in your Unit uses clause.
  3. Declare variables of TMustache and Variant to Parse and Render. See the Sample Below for a simple Tag type Name and Value.
[crayon-662e8acc581e7429108005/]

To know more about Sections, Partials and Internationalization Check out the full source code and documentation of DMustache here.

Exit mobile version