class Menu

Our class to generate menus

Properties

$menu The entries - an array of MenuEntry objects

Methods

add($entry, $push = false)

Add an entry to the menu

addLink($link, $href, $push = false, $attr = false)

Add an link to the menu

addSeparator($push = false)

Add a separator to the menu

Details

at line 26
Menu add($entry, $push = false)

Add an entry to the menu

Parameters

$entry a MenuEntry
$push true if this is to be put before the rest of the items in the menue

Return Value

Menu The instance is returned to allow chaining syntax

Add an link to the menu

Parameters

$link The text of the link - can be text, HTML, or even an img tag
$href An optional place to go when the link is clicked. Also can be a Menu.
$push true if this is to be put before the rest of the items in the menu
$attr An optional string to add within the anchor tag

Return Value

Menu The instance is returned to allow chaining syntax

at line 60
Menu addSeparator($push = false)

Add a separator to the menu

Parameters

$push true if this is to be put before the rest of the items in the menue

Return Value

Menu The instance is returned to allow chaining syntax