M
M
Maxim2016-08-21 21:33:29
Laravel
Maxim, 2016-08-21 21:33:29

Why doesn't the template render normally?

routes.php

Route::get('/', 'Product\[email protected]');

/Controllers/Product/ProductController.php
public function getProducts() 
{
  return view('product.index');
}

resources/views/product/index.blade.php
@extends('layouts.main')

@section('content')

AAA

@endsection

resources/views/layouts/main.blade.php
<!DOCTYPE html>
<html>
<head>
  <title>Test task</title>
</head>
<body>
<div class="content">

@yeild('content')

</div>
</body>
</html>

As a result, the page displays What's the problem?
@yeild('content')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nazar Mokrinsky, 2016-08-21
@1kachan

@yeild('content')->@yield('content')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question