see index.php for more information, and comments in classes.
DESCRIPTION
This package is meant to :
- generate an XML menu
- generate an HTML menu using the generated XML
xmlmenu::getInstance () determines which extensions are or are not enabled, and instanciates the correct class.
First step :
- generate the XML. Can be done with the class, or manually (the xml files are stored in 'xml/'.
They look like :
<menu><node>text1<node>text1_2</node></node><node>text2</node></menu>
3 methods :
xmlmenu::defineNode () to define a new node
xmlmenu::defineAttributes () to define attributes for a given node (can be done directly with xmlmenu::defineNode())
xmlmenu::defineLink () to define the href link of the node
Notice : the node are attributed an id via xml:id.
- see the generated xml via echo $menu (xmlmenu::__toString() method)
- save the xml file if needed via xmlmenu::xmlToFile()
- load an xml from a file via xmlmenu::fileToXml()
- apply an XSL to the menu to generate an HTML menu via xmlmenu::toHTML()
The xsl needs to be created first, of course. I have created 2, they are stored in 'xsl/'.