首页 > 代码库 > Laravel(5)你的第一个应用4

Laravel(5)你的第一个应用4

创建你的视图app/views/master.blade.php

 1 <!DOCTYPE html> 2 <html lang="en"> 3     <head> 4         <meta charset="UTF-8"> 5         <title>Cats DB</title> 6         <link rel="stylesheet" href="{{asset(‘bootstrap-3.0.0.min. 7         css‘)}}"> 8     </head> 9     <body>10         <div class="container">11             <div class="page-header">12                 @yield(‘header‘)13             </div>14             @if(Session::has(‘message‘))15                 <div class="alert alert-success">16                 {{Session::get(‘message‘)}}17                 </div>18             @endif19             @yield(‘content‘)20         </div>21     </body>22 </html>

about.blade.php

1 @extends(‘master‘)2 @section(‘header‘)3 <h2>About this site</h2>4 @stop5 @section(‘content‘)6 <p>There are over {{$number_of_cats}} cats on this site!</p>7 @stop

 

回到我们的路由.

 

Laravel(5)你的第一个应用4