If you look to laravel official documentation http://laravel.com/docs/4.2/templates It says that giving this layout:
<!-- Stored in app/views/layouts/master.blade.php -->
<html>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
按此视图扩展
@extends('layouts.master')
@section('sidebar')
<p>This is appended to the master sidebar.</p>
@stop
@section('content')
<p>This is my body content.</p>
@stop
将附加到第sidebar
节.但实际上,如果你try 是它不附加,它只是override从扩展模板的内容.
我听说其他Blade 的功能是@append, @prepend, @parent
.似乎没有人在工作.
另外,官方文档中的这个例子不起作用,我发现Blade 文档很差.比方说,Blade 式服务器的功能与@parent
没有什么不同.