Example #1
0
 * @copyright 2005, 2006 by The Classes Are Code Group (see AUTHORS file for contributor list).
 * @author John Allen <*****@*****.**>
 * @version 0.99
 * 
 */
// set the include path for XTML relative to this script
ini_set('include_path', "../../src:" . ini_get('include_path'));
require_once "XTMLProcessor.class.php";
class Language
{
    var $name;
    var $description;
    var $cssClass;
    function Language($name, $description, $cssClass = "main")
    {
        $this->name = $name;
        $this->description = $description;
        $this->cssClass = $cssClass;
    }
}
/*
 * Create a new XTMLProcessor instance. The template we want to use is called "simple.xml"
 * The XTMLProcessor will load the tag file from the same directory as the script.	
 * 
 */
$xtml = new XTMLProcessor("simple.xml");
$a = array(new Language("Java", "A modern pure object oriented language"), new Language("C++", "An extension of the original C language, adding object oriented features"), new Language("C", "A high level procedural language, that can still be used for programming the bare metal"), new Language("PHP", "A procedural web site scripting language , with object oriented features"));
$dataModel = $xtml->getDataModel();
$dataModel->set("languages", $a);
$dataModel->set("logo", "../logo");
$xtml->render();