【发布时间】:2019-12-19 18:23:08
【问题描述】:
您好,我创建了一个新的默认索引视图,但它没有加载其内容并显示空白页,我的文件结构https://ibb.co/wW337xS
索引刀片:
@extends('layouts.frontLayout.front_design')
@section('content')
<!--html here-->
@endsection
控制器:
<?php
namespace App\Http\Controllers;
use App\Index;
use Illuminate\Http\Request;
class IndexController extends Controller
{
public function index()
{
return view('index');
}
路线:
Route::resource('/','IndexController');
【问题讨论】:
-
您的视图没有内容?只是对它的评论?检查源头,那里有什么?
-
“layouts.frontLayout.front_design”是否存在?您的文件名为 index.blade.php,位于 ressources/views/ ?
-
@Qirel 检查显示所有内容
-
@jtwes 是的,它存在于其中我刚刚写了 @include('layouts.frontLayout.front_header') @yield('content') @include('layouts.frontLayout.front_footer')
-
好吧,那么它实际上并没有显示任何东西——所以在那里添加一些 HTML 吗?将
<!--html here-->替换为一些实际 文本,例如<p>Hello world</p>?
标签: laravel eloquent laravel-5.8