From 94b7ec588a93e9499d3aea7defdf44c0772b5737 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Thu, 28 Jul 2022 16:47:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/HeaderMenu/Bootstrap.php | 9 +++++++++ plugins/HeaderMenu/Views/latest_products.blade.php | 5 +++-- plugins/HeaderMenu/routes.php | 1 - 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/HeaderMenu/Bootstrap.php b/plugins/HeaderMenu/Bootstrap.php index 19c5db29..34b1739a 100644 --- a/plugins/HeaderMenu/Bootstrap.php +++ b/plugins/HeaderMenu/Bootstrap.php @@ -14,6 +14,15 @@ namespace Plugin\HeaderMenu; class Bootstrap { public function boot() + { + $this->addHeaderMenu(); + } + + + /** + * 在网页头部添加二级菜单链接 + */ + private function addHeaderMenu() { add_filter('header.categories', function ($data) { $data[] = [ diff --git a/plugins/HeaderMenu/Views/latest_products.blade.php b/plugins/HeaderMenu/Views/latest_products.blade.php index f4c42b44..cb5c1a64 100644 --- a/plugins/HeaderMenu/Views/latest_products.blade.php +++ b/plugins/HeaderMenu/Views/latest_products.blade.php @@ -4,10 +4,11 @@
+
@foreach ($products as $product)
@include('shared.product')
diff --git a/plugins/HeaderMenu/routes.php b/plugins/HeaderMenu/routes.php index d31228e2..bab9d41c 100644 --- a/plugins/HeaderMenu/routes.php +++ b/plugins/HeaderMenu/routes.php @@ -12,4 +12,3 @@ use Illuminate\Support\Facades\Route; Route::get('/latest_products', '\Plugin\HeaderMenu\Controllers\MenusController@latestProducts')->name('plugin.latest_products'); -