如何爲所有頁面製作一種佈局?例如我有:Laravel在所有頁面中的一種佈局
header.blade.php文件與我的標題。
<!doctype html>
<head>
<meta charset="utf-8">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js">
</script>
</head>
<body>
而且在login.blade.php:
@extends('layouts.header')
<form method="POST" action="/auth/login">
{!! csrf_field() !!}
<div>
Email
<input type="email" name="email" value="{{ old('email') }}">
</div>
<div>
Password
<input type="password" name="password" id="password">
</div>
<div>
<input type="checkbox" name="remember"> Remember Me
</div>
<div>
<button type="submit">Login</button>
</div>
</form>
</body>
但是當我打開登錄頁登錄後我的頭打印?爲什麼? 喜歡這個問題:
也許存在更簡單的方法來使用所有頁面的頁眉/頁腳?例如:
@extends('layouts.header')
~~somethingfile.php~~
@extends('layouts.footer')
在此先感謝
非常感謝! :) –
不客氣! @ Evaldas888 – baao