dsa88886666 2016-02-23 16:58
浏览 25
已采纳

通过BaseController从数据库发送信息到SideNavigation刀片是好的吗?

I have Layout Page that has following blade references.

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. @include('Includes.head') //reference - 1
  5. </head>
  6. <body class="nav-md">
  7. <div class="container body">
  8. <div class="main_container">
  9. @include('Includes.topheader') //reference - 2
  10. @include('Includes.sideNavigations') //reference - 3
  11. @yield('content')
  12. @include('Includes.footer') //reference - 4
  13. </div>
  14. </div>
  15. @include('Includes.footerscripts') //reference - 5
  16. </body>
  17. </html>

I want to send list of record to Side navigation. Can somebody suggest if I should use Base Controller

  • 写回答

1条回答 默认 最新

  • dtrt2368 2016-02-23 17:06
    关注

    Yes, I would use app/Http/Controllers/Controller.php and perform the query in the constructor, then pass it to the view with view()->share()

    Make sure to cache the results too so that it isn't querying on every request.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部