From 13cdf6be3bf997db522f2284cf0b357de9e4ef25 Mon Sep 17 00:00:00 2001 From: zwesy Date: Wed, 25 Nov 2020 10:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E8=8F=9C=E5=8D=95=E6=A0=8F=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/widget/Menu.php | 1 + view/public/menu.html | 42 ++++++++++++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/app/widget/Menu.php b/app/widget/Menu.php index 7cf9897..6117e2a 100644 --- a/app/widget/Menu.php +++ b/app/widget/Menu.php @@ -19,6 +19,7 @@ class Menu $data = [ 'categoryId' => $categoryId, 'menus' => $menus, + 'currentFirstId' => $currentFirstId, ]; return View::assign($data)->fetch('public/menu'); } diff --git a/view/public/menu.html b/view/public/menu.html index a0a8bda..c339b57 100644 --- a/view/public/menu.html +++ b/view/public/menu.html @@ -1,17 +1,43 @@ +{php} +function getMenus($menus, $level = 1, $currentFirstId, $categoryId) { + $menuHtml = ''; + if (count($menus) > 0) { + $menuHtml .= ''; + } + return $menuHtml; +} +{/php} +
- + {:getMenus($menus, 1, $currentFirstId, $categoryId)}
- 联系我们