關於laravel blade模板中 show stop 的測試總結

filename : main.blade.phpphp

<html>
<head>
    <title>App Name - @yield('title')</title>
</head>
<body>
@section('sidebar')
    This is the master sidebar.
@stop

<div class="container">
    @yield('content')
</div>

</body>
</html>

filename: index.blade.phphtml

@extends('layouts.main')

{{--  point to  title ,  attach  @yield    --}}
@section('title','demo')

{{--
    父@show,子()  :  頁面繼承, 父頁面滯後顯示,
    父@stop,子()  :  子頁面顯示, 父頁面被覆蓋,

    父(),子@show :  頁面繼承, 父頁面滯後顯示,
    父(),子@stop :  父頁面顯示,子頁面不顯示.

    父@show,子@show  : 頁面繼承, 父頁面滯後顯示,
    父@show,子@stop  : 子頁面顯示, 父頁面被覆蓋,

    父@stop,子@show  :  子頁面顯示, 父頁面被覆蓋,
    父@stop,子@stop  :  全部的頁面都不顯示.

--}}
@section('sidebar')
    This is the childer sidebar.
@stop
相關文章
相關標籤/搜索