i just know how to call multiple views in a single controller function.
i am trying this:
return View::make('header');
return View::make('main');
return View::make('footer');
Any suggestion.How can i call them?? thanks in advance..
i just know how to call multiple views in a single controller function.
i am trying this:
return View::make('header');
return View::make('main');
return View::make('footer');
Any suggestion.How can i call them?? thanks in advance..
You should create a view with sections for ease of re-use. It then allows you to compose the various sections.
layout.blade.php
@yield('header')
@yield('body')
@yield('footer')
combined.blade.php
@extends('layouts.layout')
@section('header')
@include('header')
@stop
@section('body')
@include('body')
@stop
@section('footer')
@include('footer')
@stop
Controller
<?php
function index()
{
return view('combined');
}
Directory structure
/resources
/views
/combined.blade.php
/layouts
/layout.blade.php