rootpackage
[ class tree: rootpackage ] [ index: rootpackage ] [ all elements ]

Class: Menus

Source Location: /Menus.php

Class Overview

PHP_Objects
   |
   --Menus

Created on 06 apr 09


Author(s):

Version:

  • 1.1

Variables

Methods


Inherited Variables

Inherited Methods

Class: PHP_Objects

PHP_Objects::__construct()
Construction function
PHP_Objects::getDB()
Database obtention function
PHP_Objects::getTable()
Table obtention function
PHP_Objects::setDebug()
Debug setting function

Class Details

[line 21]
Created on 06 apr 09

This class manages UL-LI Web Menus objects.

CHANGES: 1.1 -> 1.2: 05 may 09 Menus() is now a child of PHP_Objects() protected $this->database protected $this->table buildmenu() -> htmlentities() -> UTF-8 1.0 -> 1.1: 28 apr 09 buildMenu() recursive debug




Tags:

author:  Pierre-Dominique Vienne <pvienne@me.com>
version:  1.1
license:  GNU Public License


[ Top ]


Class Variables

$aMenu = array()

[line 43]

Variable that contains menu array.



Tags:

access:  protected

Type:   array


[ Top ]

$database =  "menugenerator"

[line 27]

Variable that contains database name.



Tags:

access:  protected

Type:   string


[ Top ]

$debug =  false

[line 54]

Variable defining the debug mode. If defined to true, the object will echo the query.



Tags:

access:  public

Type:   bool
Overrides:   Array


[ Top ]

$htmlMenu =

[line 48]

Variable that contains xHTML menu.



Tags:

access:  public

Type:   string


[ Top ]

$table =  "menu"

[line 32]

Variable that contains table name.



Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


method buildMenu [line 145]

bool|object buildMenu( [int $parentID = 0], [array $aMenuData = null], [int $level = 0])

Menu from array construction function

This function is used to construct an xHTML menu from an array stored in $this->aMenu. Result is stored in $this->htmlMenu and returned.

  1.  <?php
  2.  $oMenus        new Menus();
  3.  $oMenus->buildMenu();
  4.  echo $oMenus->htmlMenu;
  5.  // <ul><li>menu</li></ul>
  6.  ?>




Tags:

return:  menu object
since:  Version 1.0
uses:  Menus::MenuArrayFromDB()


Parameters:

int   $parentID   level from which crawling. 0 is root.
array   $aMenuData   menu data containing items
int   $level   current level of the menu

[ Top ]

method MenuArrayFromDB [line 87]

bool|object MenuArrayFromDB( string $this->database, string $this->table)

Menu array obtention function

This function is used to retrieve the menu from database. Result is stored in $this->aMenu.

  1.  <?php
  2.  $oMenus        new Menus();
  3.  $oMenus->MenuArrayFromDB();
  4.  print_r($oMenus->aMenu);
  5.  // menuarray
  6.  ?>




Tags:

return:  menu object
since:  Version 1.0
usedby:  Menus::buildMenu()
uses:  MySQL::SelectRow()


Parameters:

string   $this->database   database name
string   $this->table   table name

[ Top ]


Documentation generated on Wed, 26 Aug 2009 12:30:28 +0200 by phpDocumentor 1.4.1