步驟如下:
安裝laravel
molsen@monster:~$ composer create-project --prefer-dist laravel/laravel your-project-name
molsen@monster:~$ cd your-project-name
molsen@monster:your-project-name$
套模板框架:步驟也蠻很簡單
- 下載AdminLTE碟摆,解壓到public目錄里即可
your-project/public/adminlte
述暂,有的人喜歡用bower或npm替饿; - 在
resources/views
下創(chuàng)建文件:admin_template.blade.php
,header.blade.php
,footer.blade.php
,sidebar.blade.php
; - 按照header/footer/sidebar把public/adminlte/starter.html文件拆到以上四個文件里贸典;
- admin_template.blade.php 文件內(nèi)容如下:
@include('header')
<!-- Sidebar -->
@include('sidebar')
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
{{ $page_title or "Page Title" }}
<small>{{ $page_description or null }}</small>
</h1>
<!-- You can dynamically generate breadcrumbs here -->
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
<li class="active">Here</li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<!-- Your Page Content Here -->
@yield('content')
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<!-- Footer -->
@include('footer')
其他3個文件要怎么拆不做詳細說明视卢,自己對比著拆解一下就可以,記得把你的靜態(tài)文件路徑改一下
例如:
# 要在默認的路徑前面填上你命名的目錄
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
改為
<link rel="stylesheet" href="adminlte/dist/css/AdminLTE.min.css">
- 配置你的路由:
Route::get('admin', function () {
return view('admin_template');
});