dp198879 2018-03-23 12:13
浏览 120

使用@extend布局的Laravel问题

I am newbie to PHP Laravel Framework. I am facing a issue regarding extending layouts using @extends. Here is the scenario:-

I am having a default Layout (layout->index.blade.php), and a view extending that layout detailjournal.blade.php (journal->detailjournal.blade.php). Now i want to create partials inside journal folder. It contains leftSection.blade.php and rightSection.blade.php. What i need is to yield these two partials into the detailsjournal.blade.php.

I have tried using @include, but i want to @yield.

Is this possible? If yes then how can i achieve it?

here is the folder structure.
|-views
  |-layouts
    |- default.blade.php
  |-journal
    |-partials
      |-leftSection.blade.php
      |-rightSection.blade.php
    |-detailsjournal.blade.php
  • 写回答

3条回答 默认 最新

  • douyoupingji7238 2018-03-23 12:18
    关注

    You can simply do @include('journal.leftSection') and @include('journal.rightSection') where you want them included.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料