2013-01-15 4 views
2

내 yii webapp에 부트 스트랩 확장을 추가했으며 설치 가이드에 설명 된대로 설치했습니다. 확장 폴더의 모든 폴더는 rwrwrw이지만 위의 오류가 발생합니다. 그 이유는 무엇일까요? 나는 yii :: Import에서 경로를 이미 버렸고 그 경로는 정확했다.별칭 "bootstrap.components.Bootstrap"이 (가) 유효하지 않습니다.

감사합니다. 코드와

편집

이 내 설정이다 :

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'=>'[email protected]', 
), 

);

내 부트 스트랩 확장 당신은 두 가지 옵션이 있습니다 ./protected/extensions/bootstrap

+0

config/main.php 코드를 포함하십시오. – topher

답변

0

입니다. 하나는, 당신의 config/main.php 파일 또는 이와 동등한에 다음 줄을 추가합니다 : 당신이 당신의 부트 스트랩 폴더가 실제로 호출 무엇 이건 yii-bootstrap를 교체해야

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/yii-bootstrap'); 

.

또는 둘 중 먼저 해당 부트 스트랩 폴더를 올바르게 참조 할 수 있습니다. 내 그대로 부트 스트랩 설치가에/확장/YII - 부트 스트랩 설치되어있는 경우, 다음 구성 요소를로드하는이 별칭을 사용 : 한마디로

ext.yii-bootstrap.components.Bootstrap 

를, 당신의 문제는 제대로 설치 경로를 정의하지 않는 것 같다 . 위의 두 가지 해결책 중 하나를 사용하여 문제를 해결하십시오.

+0

예,이 행은 이미 내 config-file에 있습니다. – Gerrit

+0

부트 스트랩 폴더 내에 구성 요소라는 폴더가 있고 그 안에 Bootstrap이라는 파일이 있는지 확인 했습니까? –

+0

예! 모든 것이 정확합니다! – Gerrit

2

업데이트 구성 요소 : ext.bootstrap.src.components.Bootstrap',

EG : 당신이 확장에서 추출하는 경우, 위의 명령에 따라 :

구문 : ext.path_to.Bootstrap

4

저도 같은 문제가되었다. 폴더에 대한 전체 권한 (777)을 부여했습니다.

사용해보기.

+2

이 나를 위해 일했습니다. 감사 –

관련 문제