PHP dropdown menu?

  • ultimate11
  • Student
  • Student
  • No Avatar
  • Joined: Feb 02, 2011
  • Posts: 86
  • Status: Offline

Post March 25th, 2011, 12:16 am

guys how to add a drop down menu in php sites if your main links are in array the codes below:
Code: [ Select ]
    <div id="mainmenu">
        <?php $this->widget('zii.widgets.CMenu',array(
            'items'=>array(
                
                array('label'=>'Home', 'url'=>array('/site/index')),
                array('label'=>'Courses Offered', 'url'=>array('/site/page', 'view'=>'about')),
                array('label'=>'Admission', 'url'=>array('/site/page', 'view'=>'sample')),
                array('label'=>'Activities', 'url'=>array('/site/page', 'view'=>'link')),
                array('label'=>'Policies', 'url'=>array('/site/page', 'view'=>'link2')),
                array('label'=>'Faculty', 'url'=>array('/site/page', 'view'=>'link3')),
                array('label'=>'Gallery', 'url'=>array('/site/page', 'view'=>'link4')),
                array('label'=>'Campus', 'url'=>array('/site/page', 'view'=>'host')),
                
            ),
        )); ?>
    </div>
  1.     <div id="mainmenu">
  2.         <?php $this->widget('zii.widgets.CMenu',array(
  3.             'items'=>array(
  4.                 
  5.                 array('label'=>'Home', 'url'=>array('/site/index')),
  6.                 array('label'=>'Courses Offered', 'url'=>array('/site/page', 'view'=>'about')),
  7.                 array('label'=>'Admission', 'url'=>array('/site/page', 'view'=>'sample')),
  8.                 array('label'=>'Activities', 'url'=>array('/site/page', 'view'=>'link')),
  9.                 array('label'=>'Policies', 'url'=>array('/site/page', 'view'=>'link2')),
  10.                 array('label'=>'Faculty', 'url'=>array('/site/page', 'view'=>'link3')),
  11.                 array('label'=>'Gallery', 'url'=>array('/site/page', 'view'=>'link4')),
  12.                 array('label'=>'Campus', 'url'=>array('/site/page', 'view'=>'host')),
  13.                 
  14.             ),
  15.         )); ?>
  16.     </div>
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 25th, 2011, 12:16 am

  • coderRealm
  • Born
  • Born
  • No Avatar
  • Joined: Mar 01, 2011
  • Posts: 1
  • Status: Offline

Post April 4th, 2011, 6:36 am

this is quite helpful.. thanks, anyway.. ^_^
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Joined: May 22, 2004
  • Posts: 3415
  • Loc: Richland, WA
  • Status: Offline

Post April 4th, 2011, 8:41 am

You'd first need to get some javascript code to manage the drop down effect. After that its just a matter of printing that array into the correct format the javascript code requires.
#define NULL (::rand() % 2)
  • ultimate11
  • Student
  • Student
  • No Avatar
  • Joined: Feb 02, 2011
  • Posts: 86
  • Status: Offline

Post May 2nd, 2011, 9:49 pm

where i can get a javascript code i only have a limited knowledge in javascript...

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 168 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.