Example #1
0
 *
 * @link http://developer.berlios.de/projects/xtml/
 * @copyright 2005, 2006 by John Allen and others (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;
    function Language($name, $description, $cssClass = "main")
    {
        $this->name = $name;
        $this->cssClass = $cssClass;
        $this->description = $description;
    }
}
/*
 * 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"));
$xtml->setVar("languages", $a);
$xtml->setVar("logo", "../logo");
$xtml->render();
Example #2
0
 *
 * You should have received a copy of the GNU General Public License 
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * You may contact the authors of XTML by e-mail at:
 * developers@classesarecode.net
 *
 * The latest version of XTML can be obtained from:
 * http://developer.berlios.de/projects/xtml/
 *
 * @link http://developer.berlios.de/projects/xtml/
 * @copyright 2005, 2006 by John Allen and others (see AUTHORS file for contributor list).
 * @author John Allen <*****@*****.**>
 * @version 0.99
 * 
 */
if ($_SERVER['REQUEST_URI'] == '/') {
    header("Location: /site/home");
} else {
    ini_set('include_path', "../xtml/src:../src:" . ini_get('include_path'));
    require_once "XTMLProcessor.class.php";
    /*
     * Create a new XTMLProcessor instance.	
     * 
     */
    $xtml = new XTMLProcessor();
    $xtml->setVar("Title", "Classes Are Code");
    $xtml->setVar("QuoteOfTheDay", "An <em>OpenSource</em> development group.");
    $xtml->render();
}