久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      Laravel擴(kuò)展推薦:導(dǎo)航元素工具“Laravel Navigation”

      本篇文章給大家分享一個(gè)Laravel擴(kuò)展:Laravel Navigation包,介紹一下怎么利用Laravel Navigation 輕松構(gòu)建站點(diǎn)導(dǎo)航元素,希望對(duì)大家有所幫助!

      Laravel擴(kuò)展推薦:導(dǎo)航元素工具“Laravel Navigation”

      Laravel 9 保姆級(jí)視頻教程,想學(xué)不會(huì)都難!進(jìn)入學(xué)習(xí)

      Laravel Navigation 是 Spatie 的一個(gè)包,用于管理 Laravel 應(yīng)用程序中的菜單、面包屑和其他導(dǎo)航元素.

      Laravel擴(kuò)展推薦:導(dǎo)航元素工具“Laravel Navigation”

      推文地址

      雖然 Spatie Laravel Menu 包是 Laravel 的 Html 菜單生成器,但可以將此包視為導(dǎo)航組件的「無渲染組件」:

      app(Navigation::class)     ->add('Home', route('home'))     ->add('Blog', route('blog.index'), function (Section $section) {         $section             ->add('All posts', route('blog.index'))             ->add('Topics', route('blog.topics.index'));     })     ->addIf(Auth::user()->isAdmin(), function (Navigation $navigation) {         $navigation->add('Admin', route('admin.index'));     });  // 渲染到樹結(jié)構(gòu) app(Navigation::class)->tree();  /*  [     { "title": "Home", "url": "/", "active": false, "children": [] },     {         "title": "Blog",         "url": "/blog",         "active": false,         "children": [             { "title": "All posts", "url": "/blog", "active": false, "children": [] },             { "title": "Topics", "url": "/blog/topics", "active": true, "children": [] }         ],     },     { "title": "Admin", "url": "/admin", "active": false, "children": [] } ]  */
      登錄后復(fù)制

      使用這個(gè)包,你還可以使用以下方法從導(dǎo)航生成面包屑:

      // 在你的控制器中添加額外的頁面 app(Navigation::class)->activeSection()->add($topic->name, route('blog.topics.show', $topic));  // Render to breadcrumbs app(Navigation::class)->breadcrumbs();  /* [     { "title": "Blog", "url": "/blog" },     { "title": "Topics", "url": "/blog/topics" },     { "title": "Laravel", "url": "/blog/topics/laravel" } ] */
      登錄后復(fù)制

      你可以在 GitHub 上了解此軟件包、獲取完整的安裝說明并查看 源代碼。感謝 Sebastian De Deyne 和 Spatie 團(tuán)隊(duì)提供這個(gè)包,以及像這個(gè)一樣的所有出色的開源 PHP 和 Laravel 包

      原文地址:https://laravel-news.com/laravel-navigation

      譯文地址:https://learnku.com/laravel/t/69041

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)