haXe API Documentation
Back | Index
class haxe.Template
Available in flash8, neko, js, flash, php, cpp

Template provides a basic templating mechanism to replace values in a source String, and to have some basic logic.

A complete documentation of the supported syntax is available at: http://haxe.org/doc/cross/template

function new(str : String) : Void

Creates a new Template instance from str.

str is parsed into tokens, which are stored for internal use. This means that multiple execute() operations on a single Template instance are more efficient than one execute() operations on multiple Template instances.

If str is null, the result is unspecified.

function execute(context : Dynamic, ?macros : Dynamic) : String
static var globals : Dynamic
Global replacements which are used across all Template instances. This has lower priority than the context argument of execute().
Back | Index