mardi 17 juillet 2018

Laravel 5 - (@extends, @sections,...) not working

I am new to Laravel and I on the website I try to make all @xy aren't working and I don't find the problem. My code is following for /home:

@extends('layouts.app')

@section('content')
<h1>Home</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
@endsection

@section('sidebar')
  @parent
  <p>This is appended to the sidebar </p>
@endsection

And the code for /layouts/app.blade.php is following:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>FIXME</title>
    <link rel="stylesheet" href="/css/app.css">
  </head>
  <body>
    <div="app">
      @include('inc.navbar')

      <div class="container">
          @if(Request::is('/'))
          @include('inc.showcase')
          @endif
      </div>
      <div class="row">
      <div class="col-md-8 col-lg-8">
        @include('inc.messages')
        @yield('content')
      </div>
      <div class="col-md-4 col-lg-4">
        @include('inc.sidebar')
      </div>
    </div>
    </div>

    <footer id="footer" class="text-center">
      <p>Copyright 2018 &copy; FIXME </p>
    </footer>
  </body>
</html>

The navbar is a bootstrap template.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire