PHP Menu Maintenance Tips

Source: Internet
Author: User

The mainstream management background is generally based on the IFRAME inline framework. But there are exceptions.

The benefits of IFRAME: Menus are not maintenance-free. Do not load the menu repeatedly.

For each page to load the menu, the main is a menu selection problem.

The following is a simple and easy way.

<?PHP $action= Split ('/', $_server['php_self']); $action= $action [4]; $array _mes=Array ('viewinfo.html',        'userinfo.html',        'order.html',        'OrderInfo',        'fqcostinfo.html',        'points',        'Recordsale',        'systeminfo.html',    ); $array _JF=Array ('scoremall.html',        'Scoremallinfo',    ); $array _games=Array ('games.html',        'scratch.html',        'coupon.html',    ); $menu _cur=NULL; if(In_array ($action, $array _mes)) {$menu _cur['mes'] ='class= "cur"'; }Else if(In_array ($action, $array _jf)) {$menu _cur['JF'] ='class= "cur"'; }Else{$menu _cur[' Games'] ='class= "cur"'; }? ><divclass="Nav-wrap"> <divclass="nav"> <ul> <li <?php echo $menu _cur['mes'];?> > <aclass="Mine"href="javascript:;"> <iclass="FA Fa-home"style="font-size:22px;"></i> <cite> Information Center </cite> </a> <divclass="My-nav"> <iclass="arr"><iclass="Arr-son"></i></i> <a href="/partner.php/home/user/viewinfo.html"> My profile </a> <a href="/partner.php/home/user/order.html"> My orders </a> <a href="/partner.php/home/user/fqcostinfo.html"> My points </a> <a href="/partner.php/home/user/systeminfo.html"> My Messages </a> </div> </li> <li <?php echo $menu _cur['JF'];?>> <aclass="score"href="/partner.php/home/user/scoremall.html"> <iclass="FA Fa-gift"style="font-size:22px;"></i> <cite> points Mall </cite> </a> </li> <li <?php Echo $menu _cur[' Games'];?>> <aclass=" Games"href="/partner.php/home/user/games.html"> <iclass="FA Fa-gamepad"style="font-size:22px;"></i> <cite> Prize Games </cite> </a> </li> &L T;/ul> </div>

A small item at the bottom of the menu selection question;

Determine the current link and then match the relevant array to determine which menu to belong to.

PHP Menu Maintenance Tips

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.