私は、新しい Yii プロジェクトでYii-Bootstrapを使用しています。インストール手順に正確に従いました。
フロント ページでは、JS Carousel プラグインを使用しています。
$this->widget('bootstrap.widgets.TbCarousel', array(
'items'=>array(
array(
'image'=>'http://placehold.it/770x400&text=First+thumbnail',
'label'=>'asdf',
'caption'=>'Cras justo odio, '
),
array(
'image'=>'http://placehold.it/770x400&text=Second+thumbnail',
'label'=>'asdf',
'caption'=>'Cras justo odio, '
),
array(
'image'=>'http://placehold.it/770x400&text=Third+thumbnail',
'label'=>'asdf',
'caption'=>'Cras justo odio, '
),
),
));
Uncaught TypeError: Object [object Object] has no method 'carousel'
これにより、.carousel()
見つからないエラーが発生します。JSファイルが登録されていないようです。CSSとすべてがうまく見えます。
yii-environment 拡張機能を使用しています。
return array(
// Set yiiPath (relative to Environment.php)
'yiiPath' => dirname(__FILE__) . '/../../../yii-1.1.13/framework/yii.php',
'yiicPath' => dirname(__FILE__) . '/../../../yii-1.1.13/framework/yiic.php',
'yiitPath' => dirname(__FILE__) . '/../../../yii-1.1.13/framework/yiit.php',
// Static function Yii::setPathOfAlias()
'yiiSetPathOfAlias' => array(
// uncomment the following to define a path alias
'bootstrap' => realpath(dirname(__FILE__).'/../extensions/bootstrap')
),
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
'configWeb' => array(
'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'theme' => 'bootstrap',
// Preloading 'log' component
'preload' => array('log'),
// Autoloading model and component classes
'import' => array(
'application.models.*',
'application.components.*',
),
// Application components
'components' => array(
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
助言がありますか?