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 : Menu with icons 
and link

Tutorials

>

Tutorial Menu

>

Tutorial : Menu with icons and link


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

Tutorial : Menu with icons and link:











Go back to tutorial of the componant Menu



Source code

Source code


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

<?php
class Menu02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Menu with icons 
                                and link"
;
        
        
// Menu 1
        
$menu1 = new MenuItem("Menu 1"""
                            
"img/wsp-admin/home_16.png");
        
        
$menu_11 = new MenuItem("Menu 1.1",
                    
"http://www.meteo-europ.com");
        
$menu_12 = new MenuItem("Menu 1.2",
                    
"http://www.website-php.com");
        
$menu_13 = new MenuItem("Menu 1.3",
                    
"http://www.oracleref.com");
        
$menu1->setMenuItems(
                        new 
MenuItems(
                            
$menu_11,
                            
$menu_12,
                            
$menu_13));
        
        
// Menu 2
        
$menu2 = new MenuItem("Menu 2"""
                            
"img/wsp-admin/config_16.png");
        
$menu_21 = new MenuItem("Menu 2.1",
                    
"javascript:alert('click Menu 2.1');");
        
$menu_22 = new MenuItem("Menu 2.2",
                    
"javascript:alert('click Menu 2.2');");
        
$menu_23 = new MenuItem("Menu 2.3",
                    
"javascript:alert('click 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