我一直在尝试在 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/