lapalabs/skeleton-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

SensioLabsInsight

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.

  1. Enable the bundle in application kernel for prod environment:
<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // other bundles...
        new LapaLabs\SkeletonBundle\LapaLabsSkeletonBundle(),
    );
}
  1. Register the bundle's routes for dev environment (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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-02