Login   Register  
PHP Classes
elePHPant
Icontem

File: php4/menu.example.php4.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Corey W.  >  Menu Builder  >  php4/menu.example.php4.php  >  Download  
File: php4/menu.example.php4.php
Role: Example script
Content type: text/plain
Description: PHP 4 Compatible
Class: Menu Builder
Display nested menus of HTML links
Author: By
Last change:
Date: 5 years ago
Size: 666 bytes
 

Contents

Class file image Download
<?php
include 'menu.class.php4.php';
include 
'tidy_menu.class.php4.php';

$menu = array
(
    array
    (
        
'title' => 'Item One',
        
'url' => 'item_one.php',
    ),
    array
    (
        
'title' => 'Item Two',
        
'url' => 'item_two.php',
        
'children' => array
        (
            array
            (
                
'title' => 'Item Three',
                
'url' => 'item_three.php',
            ),
            array
            (
                
'title' => 'Item Four',
                
'url' => 'item_four.php',
            )
        )
    )
);

$attrs = array('id' => 'navigation''class' => 'menu');
$active 'item_three.php';

$menu = new menu($menu);
echo 
$menu->render($attrs$active);

echo 
"\n\n";

$tidy = new tidy_menu($menu);
echo 
$tidy->render();