gpt4 book ai didi

yii - 别名 "bootstrap.components.Bootstrap"无效

转载 作者:行者123 更新时间:2023-12-02 00:58:13 28 4
gpt4 key购买 nike

我已经在我的 yii webapp 中添加了 bootstrap Extension,并按照设置指南中的说明进行了安装。扩展文件夹中的所有文件夹都是 rwrwrw 但我收到上面写的错误。可能是什么原因?我已经转储了 yii::Import 的路径并且该路径是正确的。

谢谢!

使用代码编辑

这是我的配置:

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
//Yii::setPathOfAlias('bootstrap', '/Users/gerritlober/Sites/yii/webapp/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'=>'My Carpool',
'theme' => 'bootstrap',

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

// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),

'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'xxx',
// 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(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
),
// 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',
),*/
// uncomment the following to use a MySQL database
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=carpool_dev',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
'enableProfiling' => true,
),
'authManager'=>array(
'class'=>'CDbAuthManager',
'connectionID'=>'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',
'categories' => 'system.db.*,GLWeb.*,application.*'
),
),
),
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
),

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

);

我的 bootstrap 扩展在 ./protected/extensions/bootstrap

最佳答案

我遇到了同样的问题。我授予该文件夹的完全 (777) 权限。

试一试。

关于yii - 别名 "bootstrap.components.Bootstrap"无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14347149/

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