Blade模板繼承?和?區塊?
<!-- 文件保存于 resources/views/layouts/app.blade.php --><html><head><title>應用程序名稱 - @yield('title')</title></head><body>@section('sidebar')這是主布局的側邊欄。@show<div class="container">@yield('content')</div></body> </html>
<!-- 文件保存于 resources/views/layouts/child.blade.php -->@extends('layouts.app')@section('title', 'Page Title')@section('sidebar')<p>這將追加到主布局的側邊欄。</p>
@endsection@section('content')<p>這是主體內容。</p>
@endsection