Jignesh Rawal Jignesh Rawal - 22 days ago 13
PHP Question

Blade syntax @extends loads second HTML view and then the first HTML view

I am new to laravel and blade template engine.
Issue: file form.blade.php

@extends('front.header')
@extends('front.footer')

Loads front/footer.blade.php first and then the contents of front/header.blade.php

Please find attached the snap shot of the View Source.

I have checked few answers in stackoverflow they say about the white space.I dont seem to have any.

Regards,
Jigneshenter image description here

Answer

You cannot @extends from 2 parents. If you want to include another view, you should use @include instead

Like this :

@include('front.header')
Content
@include('front.footer')
Comments