【发布时间】:2019-01-29 17:14:33
【问题描述】:
我正在使用 laravel 5.5.45 版本并尝试第一次学习 Blade。我创建了一个文件views/layout/app.blade.php。并且想在views/contact.blade.php 中扩展app.blade.php 文件。我使用@yield 扩展了主刀片文件。
我需要对路由文件夹进行任何更改吗?
views/layout/views/layout/app.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
@yield('content')
@yield('footer')
</body>
</html>
views/contact.blade.php
@extends('layouts.app')
@section('content')
<h1>Contact Pafg</h1>
@endsection
当我点击 URL localhost/cms/public/contact 时,我在标题中看到了错误。
【问题讨论】: