PHP Classes

File: class/xmlmenu.cls.php

Recommend this page to a friend!
  Classes of Johan Barbier   XML to HTML menu   class/xmlmenu.cls.php   Download  
File: class/xmlmenu.cls.php
Role: Class source
Content type: text/plain
Description: xmlmenu factory class
Class: XML to HTML menu
Generate menus in XML and HTML
Author: By
Last change: Modification : added abstract class
Date: 18 years ago
Size: 639 bytes
 

Contents

Class file image Download
<?php
class xmlmenu {

    private function
__construct () {
       
// FORBIDDEN TO CALL THE CONSTRUCTOR ;-)
   
}

    public static function
getInstance ($sVersion = null, $sEncoding= null) {
        if (!
class_exists ('DOMDocument')) {
           
$sInstance = 'xmlmenuhasnone';
        } elseif (!
class_exists ('XSLTProcessor')) {
           
$sInstance = 'xmlmenuhasdom';
        } else {
           
$sInstance = 'xmlmenuhasboth';
        }
       
//$sInstance = 'xmlmenuhasnone'; // Just to check wether it works without DOM and XSLT :-) Remove the comments if you want to, too.
       
require_once 'class/'.$sInstance.'.cls.php';
        return new
$sInstance ($sVersion, $sEncoding);
    }
}
?>