apnet/layout-bundle

此包已被弃用且不再维护。未建议替代包。

所有站点的默认布局

安装: 903

依赖者: 1

建议者: 0

安全性: 0

星标: 1

关注者: 3

分支: 1

开放问题: 1

类型:symfony-bundle

3.2.0 2016-07-08 15:57 UTC

This package is not auto-updated.

Last update: 2019-02-20 17:39:49 UTC


README

Travis-ci status SensioLabsInsight

包含Bootstrap、jQuery和html5shiv的基础布局模板 BootstrapjQueryhtml5shiv

安装

将需求添加到composer.json文件中

{
  "require" : {
    "apnet/layout-bundle" : "~3.1"
  }
}

配置

在AppKernel.php文件中注册ApnetAsseticImporterBundleApnetLayoutBundle

// ...other bundles ...
$bundles[] = new Apnet\AsseticImporterBundle\ApnetAsseticImporterBundle();
$bundles[] = new Apnet\LayoutBundle\ApnetLayoutBundle();

Twig

使用 ApnetLayoutBundle::body.html.twig 作为所有布局Twig模板的父模板

{% extends "ApnetLayoutBundle::body.html.twig" %}

{% block title %}LayoutBundle{% endblock %}

{% block stylesheets_core %}
    {{ parent() }}

    <link href="{{ imported_asset('...css') }}" rel="stylesheet" type="text/css" />
{% endblock %}

{% block body_core %}
    <div class="container">
        ...
    </div>
{% endblock %}

{% block javascripts_core %}
    {{ parent() }}

    <script type="text/javascript" src="{{ imported_asset('...js') }}"></script>
{% endblock %}