Я пытаюсь yield использовать один из своих blade файлов, но он не работает.
Это мой index.blade.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="token" content="{{ csrf_token() }}">
<title>Forum</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100,200,300,400" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500,700' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="/css/bulma.css" rel='stylesheet' type='text/css'>
<link href="/css/all.css" rel='stylesheet' type='text/css'>
</head>
<body>
<div id="app">
@include('shared.menu.menu')
@yield('content')
</div>
<script src="/js/app.js"></script>
</body>
</html>
Это мой login.blade.php:
@extends('index')
@section('content')
@yield('shared.bar.bar')
@stop
Итак, в этот момент отображается панель навигации. Но в баре нет! Когда я заменяю: @yield('shared.bar.bar') на test, появляется test. Это shared/bar/bar.blade.php:
@section('bar')
<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title">
test
</h1>
<h2 class="subtitle">
test
</h2>
</div>
</div>
</section>
@stop
Что я делаю неправильно? Можно ли также передавать переменные в бар? Значит, я могу показывать еще title и subtitle на каждой странице?
--РЕДАКТИРОВАТЬ--
@section('bar')
<section class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title">
{{ $title }}
</h1>
<h2 class="subtitle">
{{ $subtitle }}
</h2>
</div>
</div>
</section>
@stop