我打算在驗證用戶身份後在default.blade.php中刪除@yield。如何在if語句中執行此操作?
-
@if(Auth :: check())<!-Auth :: check()方法測試用戶是否通過身份驗證,並重定向用戶->
<!-Auth :: user()獲取當前登錄的用戶。-->
- 歡迎{{Auth :: user()-> getNameOrUsername()}} li>
-
“> li>
-
“> li>
-
“> li > @萬一 ul> @if(Auth :: check())
div> @萬一 這是我的內容所在的母版頁。 default.blade.php <身體> @include('templates.partials.navigation')
@include('templates.partials.alerts') @yield('content'){{-@yield始終用於將內容從子頁面獲取到母版頁。因此,此頁面將成為母版頁。 -}} div> body> 這是子頁面。 home.blade.php我打算在用戶登錄時刪除標頭。 @extends('templates.default'){{---擴展文件夾模板也為default.blade.php ---}} @section('內容')歡迎 h1> @停
2020-12-20 08:12:57