关于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
相关文章
相关标签/搜索