2012-03-29 188 views
0

我用代碼點火器2.1.0 HMVC。我遇到錯誤 「致命錯誤:類 'CI_Base' 在電子商務未發現:\ XAMPP \ htdocs中\ HMVC \程序\ THIRD_PARTY \ MX \ Base.php上線41致命錯誤:類「CI_Base」未找到

我的目錄中的文件列表如下:

application/core/

- MY_Controller.php 
    - MY_Loader.php 
    - MY_Router.php 

application/third_party/MX/

- Base.php 
    - Ci.php 
    - Config.php 
    - Controller.php 
    - Lang.php 
    - Loader.php 
    - Modules.php 
    - Router.php 

application/modules/foo/

- controllers 
    - views 

謝謝您的幫助很大。

Base.php

<?php (defined('BASEPATH')) OR exit('No direct script access allowed'); 

/* load MX core classes */ 
require_once 'Lang.php'; 
require_once 'Config.php'; 

/** 
* Modular Extensions - HMVC 
* 
* Adapted from the CodeIgniter Core Classes 
* @link http://codeigniter.com 
* 
* Description: 
* This library extends the CodeIgniter CI_Base class and creates an application 
* object allowing use of the HMVC design pattern. 
* 
* Install this file as application/third_party/MX/Base.php 
* 
* @copyright Copyright (c) Wiredesignz 2010-09-09 
* @version  5.3.4 
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy 
* of this software and associated documentation files (the "Software"), to deal 
* in the Software without restriction, including without limitation the rights 
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
* copies of the Software, and to permit persons to whom the Software is 
* furnished to do so, subject to the following conditions: 
* 
* The above copyright notice and this permission notice shall be included in 
* all copies or substantial portions of the Software. 
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
* THE SOFTWARE. 
**/ 
class CI extends CI_Base 
{ // line 41 
    public static $APP; 

    public function __construct() { 

     parent::__construct(); 

     /* assign the application instance */ 
     self::$APP = CI_Base::get_instance(); 

     /* assign the core classes */ 
     $classes = (CI_VERSION < 2) ? array(
      'config' => 'Config', 
      'input'  => 'Input', 
      'benchmark' => 'Benchmark', 
      'uri'  => 'URI', 
      'output' => 'Output', 
      'lang'  => 'Language', 
      'router' => 'Router' 
     ) : is_loaded(); 

     foreach ($classes as $key => $class) { 
      $this->$key = load_class($class); 
     } 

     /* assign the core loader */ 
     $this->load = load_class('Loader', 'core'); 

     /* autoload application items */ 
     $this->load->_ci_autoloader(); 

     /* re-assign language and config for modules */ 
     if (! is_a($this->lang, 'MX_Lang')) $this->lang = new MX_Lang; 
     if (! is_a($this->config, 'MX_Config')) $this->config = new MX_Config; 
    } 
} 

/* create the application object */ 
new CI; 
+1

是什麼在第41行?請寫在這裏 – safarov 2012-03-29 10:43:52

+0

我已經把它放在上面編輯的一部分。 – npcoda 2012-03-29 14:55:56

回答

相關問題