我很难将引导程序连接到模块。引导位置位于:mainFolder / protected / extensions / bootstrap / theme / abound
保护/配置/ main.php
protected void ButtonFilter_Click(object sender, EventArgs e)
{
string filter = "";
int selectedCount = 0;
for (int i = 0; i < this.CheckBoxListGenres.Items.Count; i++)
if (this.CheckBoxListGenres.Items[i].Selected)
selectedCount++;
if (selectedCount > 0)
{
filter = "GenreID=";
int n = 0; //Used to determine to which genre the loop has arrived
for (int i = 0; i < this.CheckBoxListGenres.Items.Count; i++)
{
if (this.CheckBoxListGenres.Items[i].Selected)
{
if (n > 0 && n < selectedCount)
filter += " OR ";
filter+="'%"+this.CheckBoxListGenres.Items[i].Value.ToString()+"%'";
n++;
}
}
if (this.TextBoxMovieName.Text!="")
filter += " OR MovieName LIKE '%" + this.TextBoxMovieName.Text + "%'";
DataTable dataTable = ((DataSet)Application["DataSetMovies"]).Tables[0];
DataView dataView = new DataView(dataTable);
filter = Convert.ToString(filter);
dataView.RowFilter = filter;
this.DataListMovies.DataSource = dataView;
this.DataListMovies.DataBind();
}
}
保护/模块/顾问/ ConsultantModule.php
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
'modules'=>array(
'admin',
'consultant'=>array(
'preload'=>array('bootstrap'),
'components'>array(
'bootstrap'=>array(
'class'=>'bootstrap.theme.abound'
),
),
),
'candidate',
),
文件夹的结构:
class ConsultantModule extends CWebModule
{
public function init()
{
$this->setImport(array(
'consultant.models.*',
'consultant.components.*',
));
Yii::app()->getComponent('bootstrap');
}
}
运行代码时出错:
mainFolder
protected
config
**main.php**
extensions
bootstrap
assets
components
form
gii
theme
**abound**
widgets
modules
consultant
controllers
models
views
**ConsultantModule.php**
是因为模块顾问内部的属性是错误的还是我放置引导程序的方式不正确?我无法弄清楚问题。