Hi,
This is my first post and my first steps in Yii. I have installed the first version of Yii, 1.1. The installation was good but I have some troubles to install Yiistrap extensions. The widgets are fine but their format are wrong.
Browser console said:
Failed to load resource: the server responded with a status of 404 (Not Found) -> //localhost/yiiFirst/assets/66939b9c/js/bootstrap.js
Failed to load resource: the server responded with a status of 404 (Not Found) -> //localhost/yiiFirst/assets/66939b9c/css/bootstrap.css
The file main.php in folder config, the configuration is:
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias(‘local’,‘path/to/local-folder’);
Yii::setPathOfAlias(‘bootstrap’, dirname(FILE) . ‘/../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 First Application',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'bootstrap.helpers.TbHtml',
'bootstrap.components.*',
'bootstrap.form.*',
'bootstrap.helpers.*',
'bootstrap.widgets.*',
),
// path aliases
'aliases' => array(
'bootstrap' => realpath(__DIR__ . '/../extensions/bootstrap'), // change this if necessary
'vendor.twbs.bootstrap.dist' => realpath(__DIR__ . '/../extensions/bootstrap'),
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'Enter Your Password Here',
// 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',
),
);
And then in the file main.php of views/layouts I have inserted the line:
<?php Yii::app()->bootstrap->register(); ?>
I have followed all step from the Yiistrap webpage but I don’t find to fix it
Also, I have downloaded the bootstrap files and put in the folder assets but nothing happens.
Could you help me to fix this error?
Thank you in advance.