rithis/bootstrap-bundle

安装: 105

依赖: 1

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

语言:JavaScript

类型:symfony-bundle

dev-master 2012-09-17 09:00 UTC

This package is not auto-updated.

Last update: 2024-09-22 04:27:53 UTC


README

包含Twitter Bootstrap前端框架和适配模板的Symfony2 Bundle。

安装

在项目目录中运行此命令

$ composer.phar require rithis/bootstrap-bundle:@dev

之后在kernel中启用bundle

<?php
// app/AppKernel.php

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

使用

Bootstrap文件

如果您只想将Bootstrap文件包含在项目中,请运行php app/console assets:install 并包含Bootstrap

<link rel="stylesheet" href="/bundles/rithisbootstrap/css/bootstrap.min.css">

基本模板

您可以使用包含Bootstrap的基本模板 RithisBoootstrapBundle::base.html.twig 快速开始

表单主题

我们采用Bootstrap的Symfony2表单主题。您可以在全局范围内启用主题

twig:
    form:
        resources:
            - form_div_layout.html.twig
            - RithisBootstrapBundle::form.html.twig

或者您可以将主题添加到特定表单

{% form_theme form with ["RithisBootstrapBundle::form.html.twig"] %}