1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Main Page

From phpmenu

Jump to: navigation, search

Contents

Introduction

Sample Menu
- How many times have you been wondering "why-o-why they couldn't decide where this pages belong to?"
- How many pages have you updated adding just one Item on the Menu?
- Have you ever thought of that it would have been wonderful to have all Menu Items listed in one single file?

You can bear changing many pages each time or create a single file that will hold the Navigation for the whole website. Moving MenuItem from one section to another will take no more then a minute.

I'd like to introduce you to phpMenu Library - PHP Library for building Navigation blocks (Menus) for Web Site Developers. The Library allows to build Complex Navigation with folding sections, infinite number of nested subsections, visual presentation is CSS-driven. No JavaScript required.

Table of Contents

Available Classes

Menu Types

Menu 
your menu that will always show
CollapsingMenu 
your menu with the ability to collapse/fold when not active
HidingMenu 
your menu with the ability to hide when not active
SubMenu 
your sub-menu

MenuItem Types

MenuItem 
your regular Menu Item
ExternalItem 
Menu Item is External to the site
HiddenItem 
Menu Item that is not Visible in the Menu (is hidden)
GETQueryHiddenItem 
Menu Item that is not Visible in the Menu (is hidden) and activates based on GET parameters passed to the page
InactiveItem 
Menu Item that never gets the active state
PassiveItem 
Menu Item that is not a link (e.g. for Menu separators)

Attributes

$title 
item Title
$base_url 
site URL
$path 
relative path to Item
$query_id 
field name (query string related)
$query_value 
value (query string related)
$css_class 
item's class name (CSS related)
$elements 
elements of the Section (only in menu & submenu)

Instantiation

Menu ($title, $base_url)
SubMenu ($title, $path)
MenuItem ($title, $path, $css_class=NULL)
GETQueryHiddenItem ($title, $path, $query_id=NULL, $query_value=NULL, $css_class=NULL)

Important methods

setBaseURL($menu->getBaseURL())
draw($current_url)

Helper functions

newSubMenu ($title,$path,$base_url,$elements=array())

Why phpMenu

  1. You can have as many levels of navigation as you wish.
  2. The navigation is not dependant on the directory structure.
  3. It’s completely CSS-driven.
  4. It’s reusable.
  5. It’s easy-to-read.
  6. It’s customizable and extendable:
    • You can make it draw 2 levels on the left and the rest on the right side of the page.
    • You can choose to re-use some other navigation and chose only the items you need.
  7. You can use more then one navigation file per page.
Personal tools