I'm a Laravel newbie. I have just installed some 3rd party packages and I would like to integrate Twitter bootstrap into my script. Is there any way to do it, short of going into each package and adding the code to the blade templates of each view?
I'm a Laravel newbie. I have just installed some 3rd party packages and I would like to integrate Twitter bootstrap into my script. Is there any way to do it, short of going into each package and adding the code to the blade templates of each view?
This is the top/header part of my currently running application's master layout:
<!-- app/views/layouts/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.0" />
<meta name="description" content="Simple CMS" />
<meta name="author" content="Sheikh Heera" />
<link rel="shortcut icon" href={{ assets("favicon.png") }} />
<title>LaraPress</title>
<!-- Bootstrap core CSS -->
<link href = {{ asset("bootstrap/css/bootstrap.css") }} rel="stylesheet" />
<!-- Custom styles for this template -->
<link href = {{ asset("bootstrap/css/sticky-footer-navbar.css") }} rel="stylesheet" />
<!-- Optional theme -->
<link rel="stylesheet" href="{{ asset('bootstrap/css/bootstrap-theme.min.css') }}">
</head>
Follow this approach and make your each view to extend the master layout like this:
<!-- app/views/user/show.blade.php -->
@extends('layouts.master')
@section('content')
<div class="panel panel-default">
<div class="panel-heading"><label>View User</label>
<a class ='pull-right' href="{{ Request::header('referer') }}">
<i class="glyphicon glyphicon-circle-arrow-left"></i> Go Back
</a>
</div>
这是我视图的一部分(顶部部分),它扩展了主布局,使其成为主布局的一部分.Master Layout存储在app/views/layouts/
文件夹中,名称为master.blade.php
,因此,@Extensions(‘layouts.master’)表示从layouts
文件夹扩展master.blade.php
,它(名称)可以是任何内容,每个视图的文件名中.php
之前还必须包含.blade
.