alexandermatveev/bootstrap-bundle

Symfony2 的 Bootstrap Bundle

2.1-beta 2017-08-11 13:26 UTC

This package is auto-updated.

Last update: 2024-09-09 21:15:29 UTC


README

当前版本

Bootstrap.js 3.3.6

安装

将包添加到你的 composer.json 文件中

// composer.json

{
    "require": {
		// ...
        "alexandermatveev/bootstrap-bundle": "*"
    }
}

将包添加到你的应用内核中

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AlexanderMatveev\BootstrapBundle\AlexanderMatveevBootstrapBundle(),
        // ...
    );
}

使用 Composer 下载包

$ php composer.phar update alexandermatveev/bootstrap-bundle

安装资源

假设你的服务器公共目录命名为 "web",安装公共供应商资源

$ bin/console assets:install web

可选,使用 --symlink 属性创建链接而不是资源的副本

$ bin/console assets:install --symlink web

使用方法

在你的 HTML 模板中引用所需的文件,例如

<link href="{{ asset('bundles/alexandermatveevbootstrap/js/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
<script type="text/javascript" src="{{ asset('bundles/alexandermatveevbootstrap/js/bootstrap/js/bootstrap.min.js') }}"></script>

许可证

请参阅包含文件的源代码以获取许可证信息

参考

  1. https://bootstrap.ac.cn/
  2. https://symfony.com.cn