Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including header in wrong place Laravel 4

I'm trying to include header.blade.php first and than content, but it includs wrong way.

<!DOCTYPE html>
<html>
	<head>
	</head>
	<body>
		<!-- include navbar / header -->
		@include('site.components.header')
		<!-- content -->
		@yield('content')
		<!-- footer -->
		@include('site.components.footer')
	</body>
</html>

after rendering, in HTML content is included first and than header.

like image 435
Buglinjo Avatar asked Dec 15 '25 12:12

Buglinjo


1 Answers

When you create a section where you can include something , you need to stop it also like:

  @section('name of section here')
      //Your customized content for this section.
  @stop

While using @show immediately outputs that content that is it ends the current section and yields it. Yielding means this is the point the content of the section will be output.

  @section('name of section here')
      //Your customized content for this section.
  @show
like image 112
Ali Malik Avatar answered Dec 17 '25 02:12

Ali Malik