| 
<?php
 require_once("../x64Template.php");
 
 //
 //We start the object
 //
 $tpl=new x64Template();
 
 $products[]=array("name"=>"Orange","price"=>"2");
 $products[]=array("name"=>"Apple","price"=>"1.5");
 $products[]=array("name"=>"Melon","price"=>"5");
 $products[]=array("name"=>"Water Melon","price"=>"4.9");
 
 //
 //We set some values
 //
 $tpl->set("title","x64Template - Second example");
 $tpl->set("keywords","x64Template, second example");
 $tpl->set("description","x64Template - second example showing how to use arrays");
 $tpl->set("author","Atomo64");
 $tpl->set("robots","None");
 $tpl->set("message","Hi there!, why don't you take a look at the products I have?");
 
 //
 //And we can set a loop (array) the same way as we set a normal variable
 //
 $tpl->set("products",$products);
 
 //
 //Now we tell the class to parse a file
 //
 
 die($tpl->fetch("templates/example2.tpl"));
 ?>
 |