Yii YiBooster主题不起作用
我是yii的新手&我正在尝试安装booster,正如主页中所描述的那样,但没有成功 扩展工作正常,我使用“bootstrap.gii”生成了CRUD,但我使用了经典的blueprint主题。这是我的视图输出:Yii YiBooster主题不起作用,yii,yii-extensions,Yii,Yii Extensions,我是yii的新手&我正在尝试安装booster,正如主页中所描述的那样,但没有成功 扩展工作正常,我使用“bootstrap.gii”生成了CRUD,但我使用了经典的blueprint主题。这是我的视图输出: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="h
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<!-- blueprint CSS framework -->
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/screen.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/print.css" media="print" />
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/ie.css" media="screen, projection" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/main.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/css/form.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/bootstrap-yii.css" />
<link rel="stylesheet" type="text/css" href="/thouraya_booster/assets/b50f179f/css/jquery-ui-bootstrap.css" />
<script type="text/javascript" src="/thouraya_booster/assets/f74bdb93/jquery.js"></script>
<script type="text/javascript" src="/thouraya_booster/assets/b50f179f/js/bootstrap.bootbox.min.js"></script>
<script type="text/javascript" src="/thouraya_booster/assets/b50f179f/js/bootstrap.js"></script>
<title>My Web Application</title>
</head>
我不知道我是否遗漏了什么。我遇到了完全相同的问题,以下是我解决问题的方法:
另外,爱你的化身…在文件视图/layouts/main.php中删除HEAD
Yii::app()->bootstrap->register()代码>我得到了更简单、一步一步的方法:
- 将YiBooster提取到extensions文件夹,并将文件夹重命名为“YiBooster”
- 在/protected/config/main.php中添加以下代码
Yii::setPathFalias('booster',dirname(\uuuuu文件\uuuuu)
.DIRECTORY\u SEPARATOR.../extensions/yiibooster')
- 仍然在/protected/config/main.php组件中添加:
'引导'=>阵列(
'class'=>'booster.components.Bootstrap',
),
- 在我想要使用YiiBooster小部件的任何控制器中,只需输入以下代码:
公共函数过滤器()
{
返回数组(
数组('booster.filters.BootstrapFilter-delete')
);
}
- 就这样!现在尝试在视图中放置一些按钮,例如:
$this->widget(
'booster.widgets.TbButton',
排列(
'标签'=>'主',
'上下文'=>'主',
)
);
相信我,这真的很有效。我已经把它应用到我的项目中了
资料来源:
忘了提及:我正在使用Aecrud gii生成器,我不知道正常的引导生成器将如何运行。不过我很确定,如果你只使用增强小部件,它们会自动选择主题。这正是我一直在寻找的!!这对我有用!!思考!!我希望我能投赞成票,但我得到的声誉分数不到15分
// preloading 'log' component
'preload'=>array(
'log',
'bootstrap',
),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'modules'=>array(
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'root',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1'),
'generatorPaths' => array(
'bootstrap.gii'
),
),
),
// application components
'components'=>array(
'bootstrap' => array(
'class' => 'ext.bootstrap.components.Bootstrap',
'responsiveCss' => true,
),
...