1 回答

TA貢獻(xiàn)1744條經(jīng)驗 獲得超4個贊
根據(jù) Laravel 文檔:
在您的主模板中使用@yield('title')動態(tài)更改標(biāo)題
<html>
<head>
<title>App Name - @yield('title')</title> // add this code
</head>
<body>
@section('sidebar')
This is the master sidebar.
@show
<div class="container">
@yield('content')
</div>
</body>
</html>
從您的刀片模板中使用@section('title')將標(biāo)題傳遞給主布局
@extends('layouts.master')
@section('title', 'Page Title') // pass dynamic title from here
@section('sidebar')
@parent
<p>This is appended to the master sidebar.</p>
@stop
@section('content')
<p>This is my body content.</p>
@stop
- 1 回答
- 0 關(guān)注
- 101 瀏覽
添加回答
舉報