toa/twitter-bootstrap-bundle

Twitter Bootstrap 基本集成到 Symfony2

安装数: 1,378

依赖项: 0

建议者: 2

安全: 0

星标: 9

关注者: 4

分支: 5

开放性问题: 2

语言:CSS

类型:symfony-bundle

v2.1.2 2013-06-01 21:01 UTC

README

此包已不再维护。请使用 PUGXGeneratorBundle 等。

此包提供将 Twitter Bootstrap(v2.2.0) 基本集成到 Symfony 标准版 的功能。
它包含一个基于 SensioGeneratorBundle 的 CRUD 生成器。

Latest Stable Version Total Downloads

安装

toa/twitter-bootstrap-bundle 添加到 composer.json
{
    "require": {
        // ...
        "toa/twitter-bootstrap-bundle": "dev-master",
        // ...
    }
}
app/AppKernel.php 中注册此包
public function registerBundles()
{
	$bundles = array(
		// ...
		new Toa\Bundle\TwitterBootstrapBundle\ToaTwitterBootstrapBundle(),
		// ...
	);
}

使用方法

CRUD 生成

位于 ToaTwitterBootstrapBundle 中的 CRUD 生成器基于 SensioGeneratorBundle

使用 php ./app/console doctrine:generate:crud 代替
可以使用 php ./app/console toa:generate:twitter-bootstrap-crud
具有相同的选项和参数。

模板覆盖

默认 CRUD 模板位于 Resources/skeleton/crud,可以在 /app/Resources/ToaTwitterBootstrapBundle/skeleton/crud 中覆盖。
同样可以以这种方式覆盖 SensioGeneratorBundle 的基础模板。

示例 #1

所有生成的视图都继承自 ToaTwitterBootstrapBundle::layout.html.twig,可以在 /app/Resources/ToaTwitterBootstrapBundle/skeleton/crud/views/others/extends.twig.twig 中覆盖。

示例 #2

所有生成的视图都使用 content 块,可以在 /app/Resources/ToaTwitterBootstrapBundle/skeleton/crud/views/others/block.twig.twig 中覆盖。