WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Tutorial : Simple Menu

Tutorials

>

Tutorial Menu

>

Tutorial : Simple Menu


Menu-01: Tutorial of the composant Menu of the PHP FrameWork WebSite-PHP.

Tutorial : Simple Menu:











Go back to tutorial of the componant Menu



Source code

Source code


File: /pages/tutorials/menu/menu-01.php

<?php
class Menu01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple Menu";
        
        
// Menu 1
        
$menu1 = new MenuItem("Menu 1");
        
$menu_11 = new MenuItem("Menu 1.1");
        
$menu_12 = new MenuItem("Menu 1.2");
        
$menu_13 = new MenuItem("Menu 1.3");
        
$menu1->setMenuItems(
                        new 
MenuItems(
                            
$menu_11,
                            
$menu_12,
                            
$menu_13));
        
        
// Menu 2
        
$menu2 = new MenuItem("Menu 2");
        
$menu_21 = new MenuItem("Menu 2.1");
        
$menu_22 = new MenuItem("Menu 2.2");
        
$menu_23 = new MenuItem("Menu 2.3");
        
$menu2->setMenuItems(
                        new 
MenuItems(
                            
$menu_21,
                            
$menu_22,
                            
$menu_23));
        
        
// Menu 3
        
$menu3 = new MenuItem("Menu 3");
        
$menu_31 = new MenuItem("Menu 3.1");
        
$menu_32 = new MenuItem("Menu 3.2");
        
$menu_33 = new MenuItem("Menu 3.3");
        
$menu3->setMenuItems(
                        new 
MenuItems(
                            
$menu_31,
                            
$menu_32,
                            
$menu_33));
        
        
$main_menu = new Menu();
        
$main_menu->setMenuItems(
                            new 
MenuItems(
                                    
$menu1,
                                    
$menu2,
                                    
$menu3));
                                    
        
$this->render = new WSPObject($main_menu,
                        
"<br/><br/><br/><br/>",
                        
"<br/><br/><br/><br/>");
    }
}
?>


Go back to tutorial of the componant Menu


Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker