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
return
keyword stops execution of your method/function so it'll just ignore the rest of lines.
You can try concatenate that make
calls if it's what you need.
return View::make('header') . View::make('main') . View::make('footer');
But maybe it's not what you want to do? Why not using templating systems and include this files in it?