We can use a section
to define some HTML and then yield
that somewhere else.
那我们为什么要有堆栈呢?https://laravel.com/docs/5.2/blade#stacks
它用不同的关键字做完全相同的事情,但选项较少(没有继承).
@push('scripts')
<script src="/example.js"></script>
@endpush
<head>
<!-- Head Contents -->
@stack('scripts')
</head>
可通过以下部分完成:
@section('scripts')
<script src="/example.js"></script>
@endsection
<head>
<!-- Head Contents -->
@yield('scripts')
</head>