簡體   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