laravel 視圖怎么繼承公共頭部尾部
1 回答

米脂
TA貢獻1836條經驗 獲得超3個贊
在layout中設置公共頭、尾
<html>
<body>
<!-- 公共頭部代碼 -->
@yield('content')
<!-- 公共尾部代碼 -->
</body>
</html>
再新建個內容模板,content.blade.php
繼承布局模板
@extends('layout')
@section('content')
<!-- 頁面內容 -->
@stop
當然公共頭部也可以再單獨寫一個模板header.blade.php
在layout中用@include('header')
- 1 回答
- 0 關注
- 986 瀏覽
添加回答
舉報
0/150
提交
取消