laravel框架----设置公共头和公共尾

能够新建一个布局模板,layout.blade.phpphp

在layout中设置公共头、尾html

<html>

<body>



<!-- 公共头部代码 -->



@yield('content')



<!-- 公共尾部代码 -->

</body>



</html>


再新建个内容模板,content.blade.php

继承布局模板布局

@extends('layout')



@section('content')

<!-- 页面内容 -->

@stop


固然公共头部也能够再单独写一个模板header.blade.php
在layout中用@include('header')htm

相关文章
相关标签/搜索