laravel 区块继承

看到我的文章感觉有用的话,在评论区下面扣1,能够让我感受到你们的存在,也给我动力继续写的更好,谢谢

 

 

定义:

在layouts\admin.blade.php

@yield('要定义的区块名')

@yield('title')

@yield('content')

  

 

继承:

@extends ( ' 文件夹 . 文件名 ' )

@extends('layouts.admin')

@section('title','我是新标题')

@section('content')  

这里所写将更新到新内容里

@endsection

  

 

TP框架

继承

 extend name="路径/名字"

 block name="区块名"

 

<html>
    <head>
        <title>应用程序名称 - @yield('title')</title>
    </head>
    <body>
        @section('sidebar')
            这是主布局的侧边栏。
        @show

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

  

@extends('layouts.app')
 
@section('title', 'Page Title')
 
@section('sidebar')
         <p>这将追加到主布局的侧边栏。</p>
@endsection
 
@section('content')
    <p>这是主体内容。</p>
@endsection

  

 

posted @ 2018-07-02 19:09  super久违  阅读(558)  评论(0编辑  收藏  举报