【发布时间】:2015-07-24 09:55:56
【问题描述】:
我有一个基于 Yii 框架的项目。我按照本指南为我的 yii 项目实施了 boostrap,但出现错误:
Invalid Bootstrap path and CDN URL not set. Set vendor.twbs.bootstrap.dist alias or cdnUrl parameter in the configuration file.
这是网址http://www.getyiistrap.com/site/started
我关注了一切。我没有使用作曲家。我刚刚下载了 zip 文件。
这是我的配置文件供参考:
<?php
// 取消注释以下定义路径别名 // Yii::setPathOfAlias('local','path/to/local-folder');
// 这是主要的 Web 应用程序配置。任何可写的 // CWebApplication 属性可以在这里配置。 返回数组( 'basePath'=>dirname(FILE).DIRECTORY_SEPARATOR.'..', 'name'=>'我的网络应用程序',
// preloading 'log' component
'preload'=>array('log'),
// path aliases
'aliases' => array(
'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'), // change this if necessary
),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'bootstrap.helpers.*',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'password',
// 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,
),
'bootstrap' => array(
'class' => 'bootstrap.components.TbApi',
),
// 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>',
),
),
// database settings are configured in database.php
'db'=>require(dirname(__FILE__).'/database.php'),
'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',
),
);
我遵循了放置引导文件的位置。我一直在互联网上搜索,但找不到答案。谢谢
【问题讨论】:
标签: php css twitter-bootstrap yii