依照老師說的
; <div class="layui-colla-item"> <h2 class="layui-colla-title">{$left[0]['title']}</h2> <div class="layui-colla-contentlayui-show"> <ul class="layui-navlayui-nav-tree"lay-filter="test"> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> </ul>
; <div class="layui-colla-item"> <h2 class="layui-colla-title">{$left[0]['title']}</h2> <div class="layui-colla-content"> <ul class="layui-navlayui-nav-tree"lay-filter="test"> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> <li class="layui-nav-item"><a href="list.html">{$left[0]['lists'][0]['title']}</a> ;</li> </ul>
{$left[0]['lists'][0]['title']}這東西是php的變量,需要先定義
老師的應該是在某個文件設定了變數的名稱,你這直接硬抄能不出錯嗎