ven7ura/laravel-html5-boilerplate
Composer 安装命令:
composer require ven7ura/laravel-html5-boilerplate
包简介
HTML5 Boilerplate template integrated to Laravel.
README 文档
README
This package gives the user a basic front-end template to bootstrap any project. Its heavly influenced by the HTML5 Boilerplate project and it also takes advantage of the Blade template engine provided by Laravel.
The package contains the basic structure of the layout (skeleton structure) and blade files for you to start coding and adding your content. It DOES NOT contain any CSS Framework such as Bootstrap or JS library OTHER THAN some of the ones that are included with the HTML5 Boilerplate project.
Installation
Require this package with composer.
composer require ven7ura/laravel-html5-boilerplate
Publish the contents of the package to your project.
php artisan vendor:publish --provider="Ven7ura\Html5Boilerplate\Html5BoilerplateServiceProvider"
Structure
You will now have two new folders in the views folder, each with new files with unique purposes. The default structure and names are:
- common
- footer.blade.php
- header.blade.php
- navigation.blade.php
- layout
- body.blade.php
- head.blade.php
- master.blade.php
- tail.blade.php
Structure in detail
The common folder contains the files that are reusable throughout the template. You may of course remove any unnecessary files and be sure to remove the import at the body.blade.php file.
The layout folder contains the structure of the layout. These files rarely change.
- body.blade.php: contains all the structure of the
<body>content. - head.blade.php: All metadata, title, description and importing of stylesheets are contained in this blade file.
- master.blade.php: this is the file that should be extended with. All of the template is contained and imported by this file.
- tail.blade.php: this file should be used to include javascript and other data right before the closing of the
</body>tag.
Usage
After publishing the files, there will be a file named h5b.php in your config folder. This file contains some configurations that can be used to bootstrap your application.
- The
manifestvalue is relative to the public folder. Once you have that file ready you can set the path OR set it tofalseto remove the loading of a manifest file. appleiconhas the same configuration as manifest in that is relative to the public folder and can be set tofalseif not used by your application.- You can set Google Analytics by setting the
gavalue totrueand by setting yourga_id. - jQuery are used by default in HTML5 Boilerplate project, so they are included here. It's best if you compile and use the tools provided by laravel to have only one CSS and JS files. These options are to bootstrap your application.
The body.blade.php file in the layout folder should only import the common files you are going to use. Simply remove unused ones.
Make sure that the head.blade.php file in the layout folder has the correct path to your compiled css file, and that the metadata such as title are correctly used.
To use the layout is simple:
@extends('layout.master')
@section('title', 'The title of the page')
@section('description', 'Description of the page')
@section('content')
<p>Hello world! This is HTML5 Boilerplate.</p>
@stop
Advanced
There are two sections that you can use to your advantage. One is in the head.blade.php file and the other is in the tail.blade.php.
In the head.blade.php you will find a section called styles. With the blade engine you can take advantage and include custom styles to specific pages in your app by using:
@section('styles')
@parent
<link rel="stylesheet" href="{{ asset('css/anotherfile.css') }}">
@endsection
The other section is in the tail.blade.php file and its called scripts section. This is also useful when you are loading a JS library or framework for certain parts of your application.
License
Laravel HTML5 Boilerplate is licensed under The MIT License (MIT).
ven7ura/laravel-html5-boilerplate 适用场景与选型建议
ven7ura/laravel-html5-boilerplate 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 991 次下载、GitHub Stars 达 11, 最近一次更新时间为 2017 年 10 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「template」 「boilerplate」 「HTML5」 「layout」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ven7ura/laravel-html5-boilerplate 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ven7ura/laravel-html5-boilerplate 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ven7ura/laravel-html5-boilerplate 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
HTML5 support for SilverStripe
HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites.
PHP class to extend when building a WordPress plugin allowing you to follow smart plugin setup standards.
Anax htmlform module.
The yii2-videojs-widget is a Yii 2 wrapper for the [video.js](http://www.videojs.com/). A JavaScript and CSS library that makes it easier to work with and build on HTML5 video. This is also known as an HTML5 Video Player.
Laravel 5.7 Boilerplate based on Bootstrap 4 and Tabler for Backend.
统计信息
- 总下载量: 991
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-10-04