Prev | Current Page 483 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


??‘
??‘
??‘
??‘
??‘
??‘
??‘
??‘
??‘
??‘
??‘
(continued)
Separating Design
Using Templates
Templates are really a great way to create dynamic contents. In this chapter, you will see how to
use them and the following will be discussed:
What templates are and what they are used for
How to use the haxe.Template class
How to use the placeholders
How to provide some logic to templates using if and foreach
How to use macros for advanced functionalities
How to use resources to store templates
When it is better to use Motion - Twin Templo instead of haxe.Template
How to use advanced features of the Templo system
What Are Templates?
A template is a text document that contains placeholders that are dynamically replaced at run
time. The values of the placeholders are set by your application and can change to respond to the
interaction with the user.
The biggest advantage in using a template system is the separation of concerns between business
logic and user interface (UI), delegating to the template all that is visual and interactive and
maintaining the core programming outside the UI context.


Pages:
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495