如何配置yiibooster

时间:2014-09-26 08:25:47

标签: yii yii-extensions

感谢阅读,我想知道如何安装

  

YiiBooster

,我需要安装

吗?
  

YiiBootstrap

首先? 我想手动安装它,它是否足以将其解压缩到扩展文件夹而不是配置main.php或者是否有我遗漏的东西?

另外,我如何才能将这一点指向正确的道路

'booster' => array(
'class' => 'path.alias.to.booster.components.Booster',
          ),

3 个答案:

答案 0 :(得分:2)

您无需安装bootstrap。 Yiibooster包含它需要的所有引导程序文件。只需下载Yiibooster,解压缩到扩展文件夹,然后将以下内容添加到主配置文件中,

'booster' => array(
        'class' => 'ext.yiibooster.components.Bootstrap',
        'responsiveCss' => true,
        ),

然后在配置的预加载部分添加以下内容,

'booster',

答案 1 :(得分:1)

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');

// preloading 'log' component
'preload'=>array('log','bootstrap'),

// application components
'components'=>array(
//
'bootstrap' => array(
        'class' => 'bootstrap.components.Booster',
        'responsiveCss' => true,
    ),

答案 2 :(得分:0)

将文件夹名称 yiibooster-4.0.1 重命名为 yiibooster

第1步:

'preload' => array(
   'booster',
),

第2步:

'booster' => array(
'class' => 'ext.yiibooster.components.Booster', 
'responsiveCss' => true, 
),

注意:助推此类名称

//Use view file

<?php
$this->widget('booster.widgets.TbExtendedGridView',
    array(
        'filter' => $model,
        'fixedHeader' => true,
        'type' => 'striped bordered',
        'headerOffset' => 40,
        // 40px is the height of the main navigation at bootstrap
        'dataProvider' =>$model->search(),
        'template' => "{items}",
        'columns' => array(
                'id',
                'firstname',
                'lastname',
                'age',
                'address',
                'email',
            ),
    )
);
?>
相关问题