Tsugi

Menu
in package

Our class to generate menus

Table of Contents

Properties

$menu  : mixed
The entries - an array of MenuEntry objects

Methods

add()  : Menu
Add an entry to the menu
addLink()  : Menu
Add an link to the menu
addSeparator()  : Menu
Add a separator to the menu

Properties

$menu

The entries - an array of MenuEntry objects

public mixed $menu = array()

Methods

add()

Add an entry to the menu

public add(mixed $entry[, mixed $push = false ]) : Menu
Parameters
$entry : mixed

a MenuEntry

$push : mixed = false

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

Return values
Menu —

The instance is returned to allow chaining syntax

Add an link to the menu

public addLink(mixed $link, mixed $href[, mixed $push = false ][, mixed $attr = false ]) : Menu
Parameters
$link : mixed

The text of the link - can be text, HTML, or even an img tag

$href : mixed

An optional place to go when the link is clicked. Also can be a Menu.

$push : mixed = false

true if this is to be put before the rest of the items in the menu

$attr : mixed = false

An optional string to add within the anchor tag

Return values
Menu —

The instance is returned to allow chaining syntax

addSeparator()

Add a separator to the menu

public addSeparator([mixed $push = false ]) : Menu
Parameters
$push : mixed = false

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

Return values
Menu —

The instance is returned to allow chaining syntax


        
On this page

Search results