如何将 ion_auth 库与 CodeIgniter 3 HMVC 集成?

How can I integrate ion_auth library with CodeIgniter 3 HMVC?

我之前在我的项目中使用过 ion_auth,我对此没有任何问题。现在我有一个采用 HMVC 方法的项目。

这是我在设置中所做的。

  1. 我下载ion_auth
  2. 我将 ion_auth 文件夹放入我的模块并加载 sql
  3. 我授权在我的配置中加载 ion_auth
    • $autoload['libraries'] = array('session', 'auth/Ion_auth', 'acl');
  4. 我修改了ion_auth库中的加载配置

    $this->load->config('auth/ion_auth', TRUE);
    $this->load->library(array('email'));
    $this->lang->load('auth/ion_auth');
    $this->load->helper(array('cookie', 'language','url'));
    
    $this->load->library('session');
    
    $this->load->model('auth/ion_auth_model');
    

当我在浏览器中加载 ion_auth 时,它说,

Unable to load the requested class: Ion_auth

而且我还在 Auth 控制器中自动加载库

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

class Auth extends MX_Controller {

    public $autoload = array(
        'libraries' => array(
            'auth/Ion_auth', 'form_validation', 'acl'
        ),
        'helper' => array(
            'url', 'language'
        )
    );

    function __construct()
    {
        parent::__construct();
        $this->load->database();

        //$this->load->library(array('auth/ion_auth','form_validation'));
        //$this->load->helper(array('url','language'));

        $this->form_validation->set_error_delimiters($this->config->item('error_start_delimiter', 'ion_auth'), $this->config->item('error_end_delimiter', 'ion_auth'));

        $this->lang->load('auth');
    }

但还是一样的错误。

我不知道我错过了什么部分。你能帮帮我吗?

请查看以下文档。

文档:http://avenir.ro/create-cms-using-codeigniter-3/securing-admin-area-ion-auth-library/

文件结构如下。授权文件将在库内而不是模块