doz22551 2015-05-27 21:55
浏览 4
已采纳

包括在错误的地方Laravel 4头

I'm trying to include header.blade.php first and than content, but it includs wrong way.

<!DOCTYPE html>
<html>
    <head>
    </head>
    <body>
        <!-- include navbar / header -->
        @include('site.components.header')
        <!-- content -->
        @yield('content')
        <!-- footer -->
        @include('site.components.footer')
    </body>
</html>

after rendering, in HTML content is included first and than header.

</div>
  • 写回答

1条回答 默认 最新

  • duanfengdian7014 2015-05-27 22:50
    关注

    When you create a section where you can include something , you need to stop it also like:

      @section('name of section here')
          //Your customized content for this section.
      @stop
    

    While using @show immediately outputs that content that is it ends the current section and yields it. Yielding means this is the point the content of the section will be output.

      @section('name of section here')
          //Your customized content for this section.
      @show
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

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

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

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

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

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

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

客服 返回
顶部