欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Laravel 在views中加載公共頁面的實(shí)現(xiàn)代碼

 更新時(shí)間:2019年10月22日 09:26:02   作者:superwangk  
今天小編就為大家分享一篇Laravel 在views中加載公共頁面的實(shí)現(xiàn)代碼,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧

1:我們使用了Blade模板,并創(chuàng)建一個(gè)layout作為通用的模板。將子頁面作為yield輸出:

<!-- store in resource/view/layout.blade.php -->
<!DOCTYPE html>
<html>
  <head>
    <title>Laravel 5 - @yield('title')</title>

    <link rel="stylesheet" href="./style/page.css" rel="external nofollow" >
    <script src="./js/jquery.min.js"></script>
    <script src="./js/bootstrap.min.js"></script>
  </head>
  <body>
    <header>
    </header>

 @yield('content')

 
    <footer>
    </footer>
 
  </body>
</html>

2: 在子頁面使用

<!-- store in resource/view/index.blade.php -->
@extends('layout')
 
@section('title', 'test')
 
@section('content')
<style>
  .pageText {
    font-color : #00ff00;
  }
</style>
 
<div>
  Some Child Page
</div>
 
@endsection

以上這篇Laravel 在views中加載公共頁面的實(shí)現(xiàn)代碼就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論