diff options
Diffstat (limited to 'libs/Contents.php')
| -rw-r--r-- | libs/Contents.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libs/Contents.php b/libs/Contents.php index 37b2555..db9bfff 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -135,14 +135,22 @@ class Contents /** * 解析自定义导航栏 */ - static public function paresNav($data) { + static public function paresNav($data, $type) { $de_json = json_decode($data, true); $count_json = count($de_json); for ($i = 0; $i < $count_json; $i++) { $title = $de_json[$i]['title']; $link = $de_json[$i]['link']; //输出导航 - echo '<a href="'. $link .'">'. $title .'</a>'; + if($type="top-nav") { + echo '<a href="'. $link .'">'. $title .'</a>'; + } + elseif($type="mobile") { + echo '<div class="col-6"><a href="'. $link .'">'. $title .'</a></div>'; + } + elseif($type="drawer") { + echo '<a href="'. $link .'" onclick="toggleDrawer()">'. $title .'</a>'; + } } } |
