页面视图不返回,仅返回简单值

时间:2018-11-16 20:49:49

标签: php laravel laravel-5

我在使用Laravel Framework时遇到问题。我正在尝试构建布局,但是无论如何我都尝试过在浏览器中遇到同样的错误:

View [layouts.adminLayout.admin_design] not found. (View: 
E:\xampp\htdocs\laravel\ecom2\resources\views\admin\dashboard.blade.php)

m遵循本教程

     https://www.youtube.com/watch?v=bzYBu0iez3s

这是admin_design.blade.php的代码

  @include('layouts.adminLayout.admin_header')
  @include('layouts.adminLayout.admin_sidebar')   
  @yield('content')
  @include('layouts.adminLayout.admin_footer')

这是在dashboard.blade.php中

  @extends('layouts.adminLayout.admin_design')
  @section('content')

这是其控制器的代码

public function dashboard(){

return view('admin.dashboard');
}   

如果我写回声“测试”;死;

然后它显示死亡,但未显示所需的页面...此prblm是否有解决方案

1 个答案:

答案 0 :(得分:0)

根据您的使用情况,它应该是您的结构:

resources
  views
    admin
        dashboard.blade.php
    layouts
        adminLayout
            admin_header.blade.php
            admin_sidebar.blade.php
            admin_footer.blade.php
            admin_design.blade.php

如果您的layouts文件夹中有admin文件夹,则应使用admin.layouts.adminLayout.VIEW_NAME