【发布时间】:2015-05-18 04:35:33
【问题描述】:
从Laravel docs,您可以使用两种方法在布局中包含“部分”:
<html>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
既然@yield 也可以使用@yield('section', 'Default Content') 传递一些默认内容,那么@yield 是否只是不使用@parent 的@section 的简写?
@section
<!-- Nothing here -->
@show
还有哪些不同之处?
【问题讨论】:
标签: laravel laravel-blade