menu

menu is a simply little html generator really. I wrote it to easily interact with jQueryUI’s accordion menu. Essentially you add a variety of menuItems and then call the asHtml() method to generate an un-ordered list suitable for use with jQueryUI’s accordion menu.

Parent Class

None


Public Properties

$id
The name for the html ID attribute
Data Type: string
Default Value: ‘accordion’

Public Methods

\ipinga\menu __construct( [string $id] )
This is the class constructor. You can optionally provide the html ID value
Parameters:
$id (string: optional) is the value used for the html ID attribute. Default: ‘accordion’
Returns:
A menu instance
Example:
void addItem( string $tab, string $name, string $url [, string $target] )
Add an item to the menu. Internally this uses the menuItem object, but it is not exposed.
Parameters:
$tab (string) The tab name you want this option to appear on
$name (string) The menu item name (ie: the text that will appear for this link)
$url (string) The url to take the user to when they click on the menuItem
$target (string: optional) The value used for the html TARGET attribute. Default: none
Returns:
null
string asHtml()
Returns the generated HTML code, suitable for ECHOing to the user, etc.
Parameters:
None
Returns:
The HTML string