apnet / layout-bundle
此包已被弃用且不再维护。未建议替代包。
所有站点的默认布局
3.2.0
2016-07-08 15:57 UTC
Requires
- php: >=5.3.3
- apnet/bootstrap: ~3.3
- apnet/html5shiv: ~3.7
- apnet/jquery: ~2.2
- symfony/framework-bundle: ~2.3|~3.0
Requires (Dev)
- apnet/coding-standard: ~2.0
- apnet/functional-test-bundle: ~1.2
- covex-nn/twig-callable-bridge-bundle: ~1.1
- knplabs/knp-markdown-bundle: ~1.3
- phpunit/phpunit: ~4.0
- symfony/monolog-bundle: ~2.3
- symfony/symfony: ~2.3|~3.0
This package is not auto-updated.
Last update: 2019-02-20 17:39:49 UTC
README
包含Bootstrap、jQuery和html5shiv的基础布局模板 Bootstrap,jQuery 和 html5shiv
安装
将需求添加到composer.json文件中
{
"require" : {
"apnet/layout-bundle" : "~3.1"
}
}
配置
在AppKernel.php文件中注册ApnetAsseticImporterBundle 和 ApnetLayoutBundle 包
// ...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 %}