I have searched SO, and dug in the Laravel documentation but I am not sure I quite understand if what I would like to do can be done.
I am using Laravel 4. I want to know how I can nest views in other views.
For example, I have a base layout.. lets call it layout.blade.php
<html>
<head>
<title>{{ $title }}</title>
</head>
<body>
@yield('nav')
@yield('content')
</body>
</html>
Next I have a blade for a page called home
:
@extends('layout')
@section('nav')
<p>NAVIGATION</P>
@end
@section('content')
<p>HELLO WORLD!</P>
@end
I have a couple different navigation layouts, one for admins, another for super users, and another for regular users.
Is there a way to add another blade view inside the section('nav')
?
@section('nav')
// do something magical here?
@end
It doesn't make sense that for every blade layout I need to repeat the navigation code when several snippets can be reused.