我剛剛開始與Homestead新鮮的Laravel 5.3項目,我試圖爲我的網站建立一個非常簡單的結構,但我遇到了意想不到的問題。Laravel的刀片不能正常工作
- resources
-- views
--- layouts
------- master.blade.php
--- partials
------- home.blade.php
------- about.blade.php
-- index.blade.php
master.blade.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>@yield('title')</title>
<!-- Bootstrap -->
<link href="{{URL::asset('css/app.css')}}" rel="stylesheet">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
@yield('content')
<script src="{{URL::asset('js/app.js')}}"></script>
</body>
</html>
出於某種原因,<head>
標籤之間的內容輸出到<body>
標籤。
index.blade.php - 擴展主
@extends('layouts.master')
@include('partials.nav')
@section('content')
<p>yes</p>
@endsection
我該如何解決這個問題?
你可以顯示擴展master.blade.php的視圖嗎? –
如上所述,但也是什麼index.blade.php文件之外的資源文件夾等 –
增加,請參閱更新的部分 – ProEvilz