lapalabs/skeleton-bundle
最新稳定版本:v0.0.1
Composer 安装命令:
composer require lapalabs/skeleton-bundle
包简介
The HTML markup skeleton of base templates for Symfony Framework
README 文档
README
The HTML markup skeleton of base templates for Symfony Framework
Install
Install bundle with Composer dependency manager first by running the command:
$ composer require "lapalabs/skeleton-bundle:dev-master"
Composer will install the bundle to your project's vendor directory.
Include
Including the bundle to your Symfony project is as easy as to do a few simple steps.
- Enable the bundle in application kernel for
prodenvironment:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // other bundles... new LapaLabs\SkeletonBundle\LapaLabsSkeletonBundle(), ); }
- Register the bundle's routes for
devenvironment (optional, if you want to see demo examples):
# app/config/routing_dev.yml _lapalabs_skeleton_bundle: resource: "@LapaLabsSkeletonBundle/Controller/" type: annotation prefix: /_lapalabs/skeleton
Usage
The best practices is to create your own template, that extends skeleton one.
For example, create your own layout.html.twig in AppBundle:
{# src/AppBundle/Resources/views/layout.html.twig #} {% extends 'LapaLabsSkeletonBundle:html5:layout.html.twig' %} {% block css %} {{ parent() }} {# if you want to include content of parent block #} <link rel="stylesheet" href="{{ asset('bower_components/bootstrap/dist/css/bootstrap.min.css') }}"> <link rel="stylesheet" href="{{ asset('bower_components/bootstrap/dist/css/bootstrap-theme.min.css') }}"> {% endblock %} {% block js %} <script src="{{ asset('bower_components/jquery/dist/jquery.min.js') }}"></script> {% endblock %}
And then you can extends it in other templates:
{# src/AppBundle/Resources/views/Post/show.html.twig #} {% extends 'AppBundle::layout.html.twig' %} {% block content_wrap %} <h1>{{ entity.heading }}</h1> <p>{{ entity.description }}</p> {% endblock %}
Congratulations!
You're ready to rock your templates to extends skeleton templates!
More documentation:
统计信息
- 总下载量: 117
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-02