【发布时间】:2021-03-20 10:35:47
【问题描述】:
使用 Laravel,我有以下欢迎页面
</head>
<body>
</div><!--container-->
@include('partials._footer')
@endsection
@else
@section('fixx')
<p>Rivers</p>
@endsection
@endguest
</body>
</html>
和 app.blade.php
@guest
<main class="py-4">
@yield('content')
</main>
@else
<main class="py-4">
@include('partials._nav')
@yield('fixx')
@include('partials._footer')
</main>
@endguest
_nav.blade.php
<link rel="stylesheet" href="{{ URL::asset('css/nav.css') }}" />
<div class="d-flex" id="wrapper">
<!-- Page Content -->
@yield('one')
@if('Auth')
@yield('two')
@endif
</div>
但是当我看到登录用户的欢迎页面时,我可以在 @yield('two') 中看到 @yield('one') 内容
我该如何解决这个问题?
【问题讨论】:
-
我认为您的
@if('Auth')条件是错误的。你能改用@auth吗? -
此处产生错误