2013-03-11 3 views
0

Yii-Bootstrap을 설치하고 보호 된/확장 폴더에 보관하십시오. 그 후 나는 zip 파일의 압축을 풀고 부트 스트랩이라는 이름을 붙였다. http://www.cniska.net/yii-bootstrap/setup.html의 설명서입니다.yii 부트 스트랩을 설정하려면

파일 config/main.php를 this.But과 같이 바꿔서 결과를 얻지 못합니다. 내가 틀린 일을했다면 여기에 yii에 부트 스트랩을 어떻게 사용할 수 있는지 제안 해주세요.

<?php 

// uncomment the following to define a path alias 
// Yii::setPathOfAlias('local','path/to/local-folder'); 

// This is the main Web application configuration. Any writable 
// CWebApplication properties can be configured here. 
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/extensions/bootstrap'); 
return array(
    'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..', 
    'name'=>'Tantra Songs', 
    'theme'=>'bootstrap', // requires you to copy the theme under your themes directory 

    // preloading 'log' component 
    'preload'=>array('log','application.ext.bootstrap.*'), 

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

    'modules'=>array(
    // uncomment the following to enable the Gii tool 
    'gii'=>array(
     'generatorPaths'=>array(
       'bootstrap.gii', 
      ), 
    ), 
    'user'=>array(
      # encrypting method (php hash function) 
      'hash' => 'md5', 

      # send activation email 
      'sendActivationMail' => true, 

      # allow access for non-activated users 
      'loginNotActiv' => false, 

      # activate user on registration (only sendActivationMail = false) 
      'activeAfterRegister' => false, 

      # automatically login from registration 
      'autoLogin' => true, 

      # registration path 
      'registrationUrl' => array('/user/registration'), 

      # recovery password path 
      'recoveryUrl' => array('/user/recovery'), 

      # login form path 
      'loginUrl' => array('/user/login'), 

      # page after login 
      'returnUrl' => array('/user/profile'), 

      # page after logout 
      'returnLogoutUrl' => array('/user/login'), 
     ), 
), 

    // application components 
    'components'=>array(
    'user'=>array(
     // enable cookie-based authentication 
     'allowAutoLogin'=>true, 
    ), 
    'bootstrap'=>array(
      'class'=>'bootstrap.components.Bootstrap', 
     ), 
    // 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=nt_songs', 
     'emulatePrepare' => true, 
     'username' => 'root', 
     'password' => 'root', 
     'charset' => 'utf8', 
     'tablePrefix' => 'nt_', 
    ), 
    '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', 
     ), 
     */ 
    ), 
    ), 
), 

); 
+0

실제 부트 스트랩 우편 번호는 어디에서 추출 했습니까 (Yii 모듈이 아닌 실제 부트 스트랩 파일). – ernie

답변

0

내가 설정 한 경로가 다소 잘못되었다고 생각합니다. 이 시도;

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap'); 
+0

이전에 그렇게했습니다. 그러나 결과를 얻을 수 있습니다. – Ranjit

+0

잘 작동하는 구성 파일은 다음과 같습니다. http://pastebin.com/xVSPNgJj 도움이되기를 바랍니다. –

관련 문제