I have layouts.app.blade.php where I have my <html>
and <body>
tags and also the <nav>
.
In the <body>
I yield content for every page, so they basically extend this app.blade.php.
All basic Laravel stuff so now I have this:
<div class="navbar-header">
<!-- Collapsed Hamburger -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#spark-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Branding Image -->
<a class="navbar-brand" href="/">
*Dynamic page title*
</a>
</div>
// ...
@yield('content')
我想用这<a class="navbar-brand">
来显示我的页面标题.因此,这意味着它必须针对这个"parent.blade.php"中加载的每个模板(带有@Year(‘content’))进行更改.
How would I do this using Laravel 5.2?
Many thanks