Class: Menu
Source Location: /myphp-1.9/myphp-1.9-menu/html/page/Menu.php
Class Menu
Class Overview
|
Generates a Menu element (tab,top,left,right or bottom menu)
- +-------------------------------------+
- | menu1 | menu2 | menu3 | | menux | (i.e. top menu)
- +-------------------------------------+
- Usage:
- $menu = new Menu($links,$type,$text,$width,$class);
- print $menu->getHtml();
- Or
- Menu::display($links,$type,$text,$width,$class);
Located in /myphp-1.9/myphp-1.9-menu/html/page/Menu.php [line 40]
Object
|
--Html
|
--Menu
|
Properties
|
Methods
|
Inherited Properties, Constants, and Methods
Method Summary
| void |
addLinks() |
Add an array of menu links |
| String |
getHtml() |
Builds the html for a menu, and return it |
| String |
getLeftHtml() |
Get the html for the left menu links |
| String |
getTabHtml() |
Get the html for the Tab menu links |
| String |
getTopHtml() |
Get the html for the top menu links |
| void |
setMenu() |
Set the objects for the Menu |
Methods
Menu Menu(
[String
$type = ''], [String
$text = ''], [String
$width = ''], [String
$class = '']
)
|
|
Constructor
Parameters:
|
String |
$type: |
Type of menu, one of: tab, top, left, right, or bottom |
|
String |
$text: |
The text above the menu links |
|
String |
$width: |
The width of the menu |
|
String |
$class: |
The css class for the menu |
void addLinks(
array
$links
)
|
|
Add an array of menu links
The array must have the following format - $links =
- array(
- array('text'=>'text 0','href'=>'href0/','title'=>'title 0','class'=>'Menu'),
- array('text'=>'text 1','href'=>'href1/','title'=>'title 1'),
- array('text'=>'text 2','href'=>'href2/','title'=>'title 2'),
- );
Parameters:
|
array |
$links: |
The array of menu links |
void display(
array
$links, [String
$type = ''], [String
$text = ''], [String
$width = ''], [String
$class = '']
)
|
|
Display html
- Usage:
- Menu::display($links,$type,$text,$width,$class);
Parameters:
|
array |
$links: |
An array of links |
|
String |
$type: |
Type of menu, one of: tab, top, left, right, or bottom |
|
String |
$text: |
The text above the menu links |
|
String |
$width: |
The width of the menu |
|
String |
$class: |
The css class for the menu |
API Tags:
Redefinition of:
- Html::display()
- Display the html
Redefined in descendants as:
Get the html for the bottom menu links
API Tags:
Builds the html for a menu, and return it
API Tags:
Redefinition of:
- Html::getHtml()
- Get Html
Get the html for the left menu links
API Tags:
String getLeftRightHtml(
)
|
|
Get the html for the left menu links
API Tags:
Get the html for the right menu links
API Tags:
Get the html for the Tab menu links
API Tags:
Get the html for the top menu links
API Tags:
void setMenu(
String
$type
)
|
|
Set the objects for the Menu
Parameters:
|
String |
$type: |
one of tabmenu, topmenu, leftmenu, rightmenu, or bottommenu |
|
|