include(TbWidget.php): failed to open stream: No such file or directory
вот она полностью
Код: Выделить всё
PHP warning
include(TbWidget.php): failed to open stream: No such file or directory
C:\xampp\htdocs\yii\framework\YiiBase.php(427)
415 {
416 include($classFile);
417 if(YII_DEBUG && basename(realpath($classFile))!==$className.'.php')
418 throw new CException(Yii::t('yii','Class name "{class}" does not match class file "{file}".', array(
419 '{class}'=>$className,
420 '{file}'=>$classFile,
421 )));
422 break;
423 }
424 }
425 }
426 else
427 include($className.'.php');
428 }
429 else // class name with namespace in PHP 5.3
430 {
431 $namespace=str_replace('\\','.',ltrim($className,'\\'));
432 if(($path=self::getPathOfAlias($namespace))!==false)
433 include($path.'.php');
434 else
435 return false;
436 }
437 return class_exists($className,false) || interface_exists($className,false);
438 }
439 return true;
Stack Trace #0 + C:\xampp\htdocs\yii\framework\YiiBase.php(427): YiiBase::autoload()
#1 unknown(0): YiiBase::autoload("TbWidget")
#2 – C:\xampp\htdocs\internetsite.com.ua\protected\extensions\bootstrap\widgets\TbNav.php(65): spl_autoload_call("TbWidget")
60 /**
61 * Initializes the widget.
62 */
63 public function init()
64 {
65 $this->attachBehavior('TbWidget', new TbWidget);
66 $this->copyId();
67 $route = $this->controller->getRoute();
68 if ($this->stacked) {
69 TbHtml::addCssClass('nav-stacked', $this->htmlOptions);
70 }
#3 + C:\xampp\htdocs\yii\framework\web\CBaseController.php(147): TbNav->init()
#4 + C:\xampp\htdocs\yii\framework\web\CBaseController.php(172): CBaseController->createWidget("bootstrap.widgets.TbNav", array("type" => "pills", "items" => array(1 => array("id" => "1", "parent_id" => "0", "label" => "Первое меню", "items" => array(2 => array("id" => "2", "parent_id" => "1", "label" => "Подменю для 1"))), 3 => array("id" => "3", "parent_id" => "0", "label" => "Меню2"))))
#5 – C:\xampp\htdocs\internetsite.com.ua\protected\views\site\index.php(26): CBaseController->widget("bootstrap.widgets.TbNav", array("type" => "pills", "items" => array(1 => array("id" => "1", "parent_id" => "0", "label" => "Первое меню", "items" => array(2 => array("id" => "2", "parent_id" => "1", "label" => "Подменю для 1"))), 3 => array("id" => "3", "parent_id" => "0", "label" => "Меню2"))))
21
22 <?php
23 $this->widget('bootstrap.widgets.TbNav', array(
24 'type' => TbHtml::NAV_TYPE_PILLS,
25 'items' => $menuha,
26 ));
27 ?>
#6 + C:\xampp\htdocs\yii\framework\web\CBaseController.php(126): require("C:\xampp\htdocs\internetsite.com.ua\protected\views\site\index.p...")
#7 + C:\xampp\htdocs\yii\framework\web\CBaseController.php(95): CBaseController->renderInternal("C:\xampp\htdocs\internetsite.com.ua\protected\views\site\index.p...", array("menuha" => array(1 => array("id" => "1", "parent_id" => "0", "label" => "Первое меню", "items" => array(2 => array("id" => "2", "parent_id" => "1", "label" => "Подменю для 1"))), 3 => array("id" => "3", "parent_id" => "0", "label" => "Меню2"))), true)
#8 + C:\xampp\htdocs\yii\framework\web\CController.php(869): CBaseController->renderFile("C:\xampp\htdocs\internetsite.com.ua\protected\views\site\index.p...", array("menuha" => array(1 => array("id" => "1", "parent_id" => "0", "label" => "Первое меню", "items" => array(2 => array("id" => "2", "parent_id" => "1", "label" => "Подменю для 1"))), 3 => array("id" => "3", "parent_id" => "0", "label" => "Меню2"))), true)
#9 + C:\xampp\htdocs\yii\framework\web\CController.php(782): CController->renderPartial("index", array("menuha" => array(1 => array("id" => "1", "parent_id" => "0", "label" => "Первое меню", "items" => array(2 => array("id" => "2", "parent_id" => "1", "label" => "Подменю для 1"))), 3 => array("id" => "3", "parent_id" => "0", "label" => "Меню2"))), true)
#10 – C:\xampp\htdocs\internetsite.com.ua\protected\controllers\SiteController.php(38): CController->render("index", array("menuha" => array(1 => array("id" => "1", "parent_id" => "0", "label" => "Первое меню", "items" => array(2 => array("id" => "2", "parent_id" => "1", "label" => "Подменю для 1"))), 3 => array("id" => "3", "parent_id" => "0", "label" => "Меню2"))))
33 foreach ($result as $value){
34 $data[$value['id']]=array('id'=>$value['id'],'parent_id'=>$value['parent_id'],'label'=>$value['title']);
35 }
36 $dat = Menu::mapTree($data);
37
38 $this->render('index',array('menuha'=>$dat));
39 }
40
41
42
43 /**
#11 + C:\xampp\htdocs\yii\framework\web\actions\CInlineAction.php(49): SiteController->actionIndex()
#12 + C:\xampp\htdocs\yii\framework\web\CController.php(308): CInlineAction->runWithParams(array())
#13 + C:\xampp\htdocs\yii\framework\web\CController.php(286): CController->runAction(CInlineAction)
#14 + C:\xampp\htdocs\yii\framework\web\CController.php(265): CController->runActionWithFilters(CInlineAction, array())
#15 + C:\xampp\htdocs\yii\framework\web\CWebApplication.php(282): CController->run("")
#16 + C:\xampp\htdocs\yii\framework\web\CWebApplication.php(141): CWebApplication->runController("")
#17 + C:\xampp\htdocs\yii\framework\base\CApplication.php(180): CWebApplication->processRequest()
#18 + C:\xampp\htdocs\internetsite.com.ua\index.php(13): CApplication->run()
2014-03-18 14:10:45 Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 Yii Framework/1.1.14
Вот мой main.php
Код: Выделить всё
<?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.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'My Web Application',
'aliases' => array(
'bootstrap' => realpath(__DIR__.'/../extensions/bootstrap'),
),
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
'bootstrap.helpers.TbHtml',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'generatorPaths' => array('bootstrap.gii'),
'password'=>'123',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
// 'ipFilters'=>array('127.0.0.1','::1'),
),
'adminka',
),
// 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>',
),
),
/*
'db'=>array(
'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
),
*/
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=internetsite',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
// uncomment the following to use a MySQL database
/*
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=testdrive',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
*/
'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'=>'[email protected]',
),
);
Код: Выделить всё
<?php $this->widget('bootstrap.widgets.TbNav', array(
'type' => TbHtml::NAV_TYPE_PILLS,
'items' => $menuha,
)); ?>
PS: работаю на локалхосте с помощью xampp