zoukankan      html  css  js  c++  java
  • 桂电在线-php-提取菜单到配置文件2

    继续昨晚没完成的主菜单模板:

    <!-- 菜单块 -->
        <div class="on-light" id="menus">
            <?php foreach ($menus as $menu_key => $menu): ?>
    
            <?php 
                // 排除校园名片
                if ($menu_key == 'card') 
                    break;
            ?>
    
            <section class="container" id="<?=$menu_key?>-menus">
                <header class="col-xs-12 text-center">
                    <h2 class="bs-docs-featurette-title"><?=$menu['name']?></h2>
                    <p class="lead"><?=$menu['description']?></p>
                </header>
    
                <div class="row bs-docs-featured-sites">
                    
                <?php foreach( $menu['submenus'] as $key => $submenu ): ?> 
                    <?php $i = $key + 1; ?>
                    <div class="col-xs-6 col-sm-3">
                        <a href="<?=site_url( $submenu['link'] )?>" class="menu menu<?=$i?>"><?=$submenu['name']?></a>
                    </div> 
    
                    <?php  
                        // 如果存在下一个子菜单 && 取模等于0
                        $next_sm = next($menu['submenus']);
                    ?>                
                    <?php if( isset($next_sm) && $i % 4 == 0 ): ?>
                    </div>
                    <div class="row bs-docs-featured-sites">
                    <?php endif ?>
    
                <?php endforeach ?>
    
                </div>
            </section>            
            <?php endforeach ?>
    
        <section class="container" id="cards-menus">
            <header class="col-xs-12 text-center">
                <h2 class="bs-docs-featurette-title">校园名片</h2>
                <p class="lead">校内朋友圈,你可能认识他们喔!?</p>
            </header>
            <!-- 杰出校友 -->
            <div class="row text-right">
                <div class="col-xs-12 text-right">
                    <a href="" class="btn btn-primary">
                        更多校友
                        <i class="glyphicon glyphicon-chevron-right"></i>
                    </a>
                </div>
            </div>
            <div class="row bs-docs-featured-sites">
                <div class="col-xs-6 col-sm-3">
                    <a href="">
                        <img src="<?=__PUBLIC__?>images/test.jpg" alt="" class="img-responsive"/></a>
                </div>
                <div class="col-xs-6 col-sm-3">
                    <a href="">
                        <img src="<?=__PUBLIC__?>images/test.jpg" alt="" class="img-responsive"/></a>
                </div>
                <div class="col-xs-6 col-sm-3">
                    <a href="">
                        <img src="<?=__PUBLIC__?>images/test.jpg" alt="" class="img-responsive"/></a>
                </div>
                <div class="col-xs-6 col-sm-3">
                    <a href="">
                        <img src="<?=__PUBLIC__?>images/test.jpg" alt="" class="img-responsive"/></a>
                </div>
            </div>
        </section>
    </div>

    总结一下:

    1.取模计数计数从1开始

    2.权限点和菜单分开,需创建权限点文件

  • 相关阅读:
    用到的一些方法
    Android屏蔽Home键
    Android自定义GridView显示一行,并且可以左右滑动
    模糊匹配字母大小写
    Android四大组件之Content Provider的学习
    用于小数据存储的SharedPreferences
    Android小知识点
    【译】用C/C++操作链表
    和好友的QQ记录,多关注哈需要关怀的人
    岁不待人_20080321
  • 原文地址:https://www.cnblogs.com/jdhu/p/4193101.html
Copyright © 2011-2022 走看看