Book Image

haXe 2 Beginner's Guide

5 (1)
Book Image

haXe 2 Beginner's Guide

5 (1)

Overview of this book

Table of Contents (21 chapters)
haxe 2
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 9. Templating

Using templates.

Templates are a very useful feature of haXe. They help the developer with his job of presenting data to the user by making it easy to repeat some parts of a view (or page) and by allowing some branching depending on data.

As developers our job is to create programs that allow the manipulation of data. That's the basis of our job, but beyond this part of the job, we must also be able to present that data to the user. Programs that don't have a user interface exist, but since you are reading this book about haXe, there is a greater chance that you are mostly interested in web applications, and almost all web applications have a User Interface of some kind. However, these can also be used to create XML documents for example.

In this chapter, we will cover templating by talking about:

  • The included haxe.Template class

  • The syntax used by the templating system

  • How data is passed to the templating system

  • How a template can execute some actions

So if you are ready...