gpt4 book ai didi

php - 属性 "CWebUser.bootstrap"未定义

转载 作者:行者123 更新时间:2023-12-04 05:23:45 26 4
gpt4 key购买 nike

我有一个使用 yii 框架的站点。首先,在我启动并运行站点后,我想安装 bootstrap (yii-bootstrap-1.2.0.r300.zip)。然而,这并不顺利。

我收到以下错误“未定义属性“CWebUser.bootstrap”。”

Bootstrap 扩展被放置为/site/protected/extensions/bootstrap

我的主配置文件看起来像这样

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'PeerPilot',
'theme'=>'newssourcefinal', // biskit is sub directory name under theme directory

// 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'=>'helloworld',
'generatorPaths'=>array(
'bootstrap.gii',),
// If removed, Gii defaults to localhost only. Edit carefully to taste.
// 'ipFilters'=>array('127.0.0.1','::1'),
),
),

// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
'bootstrap'=>array(
'class'=>'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
),
),
// uncomment the following to enable URLs in path-format
/*
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
*//*
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),

'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
),

// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);

最佳答案

替换你的 config/main.php 如下

'components'=>array(
//..........
'user'=>array(
'allowAutoLogin'=>true,
),

'bootstrap' => array(
'class'=>'ext.bootstrap.components.Bootstrap'
)
)

关于php - 属性 "CWebUser.bootstrap"未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13431165/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com