步骤如下:
安装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
下创建文件:admin_template.blade.php
,header.blade.php
,footer.blade.php
,sidebar.blade.php
; - 按照header/footer/sidebar把public/adminlte/starter.html文件拆到以上四个文件里;
- admin_template.blade.php 文件内容如下:
@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个文件要怎么拆不做详细说明,自己对比着拆解一下就可以,记得把你的静态文件路径改一下
例如:
# 要在默认的路径前面填上你命名的目录
<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');
});
网友评论