首页 > PHP
分类导航三级循环
来源:TP课堂 时间:2021-01-11 点击:706



 {volist name="$categoryDataTree" id="vo"}
        <li>

          <a href="{:url('index/index/'.$vo.index_template,array('cate_id'=>$vo.id))}" {if condition='$current_id eq 6' }now{/if}>{$vo.cate_name}</a>
          {php}
                if(isset($vo['children'])){
                {/php}
          <div class="leval2">
            <ul>
              {volist name="$vo.children" id="vo1"}
              <li>
                <a href="{:url('index/index/'.$vo1.index_template,array('cate_id'=>$vo1.id))}">{$vo1.cate_name}</a>
                {php}
                if(isset($vo1['children'])){
                {/php}
                <div class="child_content">

                  {volist name="$vo1.children" id="vo2"}
                  <a class="item" href="{:url('index/index/product',array('cate_id'=>$vo2.id))}">{$vo2.cate_name}</a>
                  {/volist}

                </div>
                {php}}{/php}
              </li>
              {/volist}
            </ul>
          </div>
          {php}}{/php}
        </li>
        {/volist}