Home » Articles » Template introduction » Hello World

Hello World

In this example, we render a template with a name in it, the name is configurable, so it's not really hello world, unless we want it to be :o)
Our example is run below:
HTML:

<div id="example1_output"></div>
Javascript:
pax.load.onloaded( function() {
    //  Setup a template
    var myTemplate = "Hello [:= name :]!";
   
    //  Create some data for our template
    var data = { name: "World" };
   
    //  Render the template and data
    pax.template.render( myTemplate, { value: data, target: pax.$("example1_output") } );
} );
We setup a template, some data, and then run the pax.template.render method, to display the output. In this template we're simply using the value tag
Result:
Well, that was easy! Read on for modifiers!