致命错误:Class' CI_Base'未找到

时间:2012-03-29 10:06:49

标签: codeigniter

我使用Code Igniter 2.1.0进行HMVC。我收到了错误" 致命错误:Class' CI_Base'在第41行的E:\ xampp \ htdocs \ hmvc \ application \ third_party \ MX \ Base.php中找不到"

我的文件目录列表是:

  

应用/核心/

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

应用/ THIRD_PARTY / MX /

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

应用/模块/富/

    - 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 个答案:

答案 0 :(得分:0)

您使用旧版

@copyright   Copyright (c) Wiredesignz 2010-09-09
@version     5.3.4

它无法使用codeigniter 2.0&lt;

尝试最新版本(5.4)http://codeigniter.com/wiki/Modular_Extensions_-_HMVC