Skip to content

ajukraine/hxdtl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9d90de0 · Jun 19, 2015

History

82 Commits
Mar 30, 2013
Jun 19, 2015
Mar 31, 2013
Mar 30, 2013
Jun 19, 2015
Jun 19, 2015
Mar 30, 2013
Jun 19, 2015
Jun 9, 2013
Mar 31, 2013
Apr 26, 2013
Mar 30, 2013
Jun 10, 2013
Jun 10, 2013
Mar 31, 2013
Jun 10, 2013
Jun 19, 2015
Mar 30, 2013
Jun 19, 2015

Repository files navigation

HxDTL

HxDTL is a Haxe implementation of Django Template Language.

Status Build Status

Current release: HxDtl 0.1.1. Be aware of the changes to the API - it's not stable and will be modified in future releases.

You can also explore Roadmap to see the upcoming release details.

Installation

Haxelib release

$ haxelib install hxdtl

Latest development version

$ git clone https://github.com/ajukraine/hxdtl.git
$ cd hxdtl
$ git submodule update --init
$ haxelib install mlib
$ haxe install.hxml

Usage

Create template from string and render it:

import hxdtl.Template;

var tpl = new Template("
{% if Year > 2012 %}
	We have survived!
{% else %}
	Hey, {{ friend }}, are we dead?
{% endif %}
");
var data = { Year: 2013, friend: "Billy" };

trace(tpl.render(data));

Get template from file system and render it:

import hxdtl.Template;
import hxdtl.Environment;

var env = new Environment({
	path: "path/to/templates",
	useCache: true
});
var tpl = env.getTemplate("some_template.dtl");

trace(tpl.render({ Year: 2013, friend: "Billy" }));

About

HxDTL - Haxe implementation of Django Template Language

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages