我的html代码是
master.blade.php是
@yield('title')
@yield('css')
@yield('js')
menu.blade.php是
sidebar.blade.php是
footer.blade.php是
我的查看文件是home.blade.php
@extends('layouts.master')
@section('title')
:: Login ::@stop
@section('js')
@stop
@extends('layouts.menu')
@extends('layouts.sidebar')
@extends('layouts.footer')
router.php
Route::get('home', array('uses' => 'HomeController@home'));
HomeController.php是
public function home()
{
return View::make('home');
}
我跑
localhost/project/public/index.php/home
它只显示主刀片文件的内容,y边栏,页脚和菜单未显示,这是什么错误.
解决方法:
创建一个包含菜单的布局@,包括:
@yield('title')@yield('css')
@yield('js')
@include('menu')
@yield('content')
您的菜单:
和您的看法:
@extends('layouts.master')
@section('title')
:: Login ::
@stop
@section('content')
This is your content!
@stop
标签:laravel-4,html,php
来源: https://codeday.me/bug/20191029/1963220.html