php - 如何在 Yii 中使用 Bootstrap ?

标签 php twitter-bootstrap yii

我一直在尝试在 Yii 中实现 twitter bootstrap 扩展,但做不到。

我按照下面的指南使用 Yii 安装它。

http://www.cniska.net/yii-bootstrap/setup.html

我按照上述指南将以下代码复制并粘贴到我的主配置文件中。

// Define a path alias for the Bootstrap extension as it's used internally.
// In this example we assume that you unzipped the extension under     protected/extensions.
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

return array(
'theme'=>'bootstrap', // requires you to copy the theme under your themes directory
'modules'=>array(
    'gii'=>array(
        'generatorPaths'=>array(
            'bootstrap.gii',
        ),
    ),
),
'components'=>array(
    'bootstrap'=>array(
        'class'=>'bootstrap.components.Bootstrap',
    ),
),
);

谁能帮忙。

最佳答案

找到您需要的答案,将以下内容放入 protected/views/layouts 文件夹的 main.php 文件中 <head> 之间的任意位置和 </head>标签。

    <?php Yii::app()->bootstrap->registerAllCss(); ?>

关于php - 如何在 Yii 中使用 Bootstrap ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14125201/

相关文章:

php - 序列化时,Doctrine oneToMany 关系导致反向实体上的外键为 null

php - Mysql Lock Tables 100%保证只有一个用户可以编辑?

php - 单击每行中的按钮时,如何更新显示 sql 数据的 html 表行?

php - 正则表达式 $1、$2 等

twitter-bootstrap - 带有下拉菜单的 Bootstrap-4 按钮选择的值不显示

angularjs - Angular 带时间选择器节省不同的时间

javascript - 可调整大小且灵活的输入表单

mysql查询在不同的服务器上给出不同的结果

php - 当用户在 YII 中注销时,与 session 关联的行将被删除

mysql - sql 双内连接 : using group_concat gives empty result set