0

我在codeigniter中遇到了ckeditor和kcfinder的问题,当我想浏览这样的图像错误时,我使用了wiredesignz codeigniter-modular-extensions-hmvc中的HMVC

Fatal error: Call to a member function item() on null in C:\xampp\htdocs\mypro\abbas_eterna\application\third_party\MX\Modules.php on line 8

遇到 PHP 错误

严重性:错误

消息:在 null 上调用成员函数 item()

文件名:MX/Modules.php

行号:8

回溯:

当我不使用 HMVC 访问 ckeditor 并从 kcfinder 浏览图像时很好,而使用 HMVC 时很麻烦。我已经在这个 stackoverflow 和谷歌中搜索了参考,但对我来说不是同样的麻烦。我已经在 application/config.php 中声明了

    $config['modules_locations'] = array(
    APPPATH.'modules/' => '../modules/',
);

和根文件夹中的配置文件索引

$system_path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'system';
$application_folder = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'application';

我使用我在文件夹asset/kcfinder/conf/config.php中设置的会话

ob_start();
include('./../../index.php');
ob_end_clean();
$CI =& get_instance();
$CI->load->driver('session');
if(@$_SESSION['upload_image_file_manager'] == TRUE){
    $codeigniterAuth = false;
} else {
    $codeigniterAuth = true;
}
4

2 回答 2

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

(defined('EXT')) OR define('EXT', '.php');

global $CFG;

/* get module locations from config settings or use the default module location and offset */
is_array(Modules::$locations = $CFG->item('modules_locations')) OR Modules::$locations = array(
    APPPATH.'modules/' => '../modules/',
);

/* PHP5 spl_autoload */
spl_autoload_register('Modules::autoload');
于 2018-12-05T01:41:47.997 回答
0

出现那个错误是因为有全局变量,一开始,这个文件你可以这样做

Modules::$locations = array(
    APPPATH.'modules/' => '../modules/',
);

反而

is_array(Modules::$locations = $CFG->item('modules_locations')) OR 
Modules::$locations = array(
    APPPATH.'modules/' => '../modules/',
);
于 2019-10-30T12:47:29.820 回答