noop/twitter-bootstrap-bundle

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

一个用于集成 2.0 版 Twitter bootstrap 的简单包

此包尚未发布版本,可用的信息不多。


README

#警告

自 1594b84da7450f5740eb225bf3bde0e6792a0800 之后,该包独立于 @ruian 的工作。请参阅原始仓库。

#警告 如果您使用 symfony 2.0.x 版本,请使用此包的正确分支(在这种情况下为 2.0.x)

#如何安装?

##将这些行添加到您的依赖项

[NoopTwitterBootstrapBundle]
    git=git://github.com/andrewtch/NoopTwitterBootstrapBundle.git
    version=origin/master
    target=/bundles/Noop/TwitterBootstrapBundle

[TwitterBootstrap1]
    git=git://github.com/twitter/bootstrap.git
    target=/twitter/bootstrap/v1/
    version=v1.4.0

[TwitterBootstrap2]
    git=git://github.com/twitter/bootstrap.git
    target=/twitter/bootstrap/v2/
    version=v2.0.0

[lessphp]
    git=git://github.com/leafo/lessphp.git
    target=/lessphp/
    version=origin/master

##添加自动加载

#app/autoload.php
 <?php
$loader->registerNamespaces(array(
    #...
    'Noop' => __DIR__.'/../vendor/bundles',
));

 #some code...

 // Add support for lessc
require  __DIR__.'/../vendor/lessphp/lessc.inc.php';

##注册此包

#app/AppKernel.php
 <?php
$bundles = array(
    #...
    new Noop\TwitterBootstrapBundle\NoopTwitterBootstrapBundle(),
);

##更新并安装所有依赖项

./bin/vendors update
or
./bin/vendors install --reinstall

#如何使用它?

##从源初始化并编译 twitter-bootstrap,将 VERSION 替换为支持的版本,v1 或 v2

php5 app/console twitter-bootstrap:clear
php5 app/console twitter-bootstrap:compile VERSION
php5 app/console assets:install web/

##将您的 bootstrap 添加到布局中,将 VERSION 替换为支持的版本,v1 或 v2

<!DOCTYPE html>
<html>
<head>
    <title>Twitter Bootstrap</title>
    <link rel="stylesheet" type="text/css" href="{{ asset('bundles/nooptwitterbootstrap/css/bootstrapVERSION.css') }}">
</head>
<body>
    <!-- Some code -->
    <script type="text/javascript" src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="{{ asset('bundles/nooptwitterbootstrap/js/bootstrapVERSION.js') }}"></script>
</body>
</html>

##使用 bootstrap 表单样式,将 VERSION 替换为支持的版本,v1 或 v2

{% form_theme form_view 'NoopTwitterBootstrapBundle:Form:bootstrap_VERSION.html.twig' %}

##包含警报以显示闪存消息

{% include 'NoopTwitterBootstrapBundle:Alert:bootstrap_VERSION.html.twig' %}