Laravel刀片:模板无法渲染

问题描述 投票:-3回答:1

这个工作正常,可以在视图文件夹的我的页面文件夹中找到

@extends('layouts.app')
@section('content')
    <h2>This is an awesome application. My about page.</h2>
    <p>It is very awesome that I am coding it with laravel</p>
@endsection

我不得不使用@include而不是@extend。在指出使用@include后,这个工作正常。

虽然这个没有在视图文件夹中的post文件夹中找到

@include('layouts.app')
@section('content')
    <a href="/posts" class="btn btn-default">Go Back</a>
    <h1>{{ $post->title}}</h1>
    <p>{{ $post->body}}</p>
    <small>{{ $post->created_at }}</small>
@endsection
php laravel view frameworks laravel-blade
1个回答
1
投票

而不是@include使用@extends

同时尝试使用<p></p>标签关闭<small>标签

</small>
© www.soinside.com 2019 - 2024. All rights reserved.