繁体   English   中英

如何将 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');
    }

但还是同样的错误。

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

文件结构如下。 身份验证文件将在库中而不是在模块中

在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM