【问题标题】:How can I integrate ion_auth library with CodeIgniter 3 HMVC?如何将 ion_auth 库与 CodeIgniter 3 HMVC 集成?
【发布时间】:2015-10-29 01:30:42
【问题描述】:

我之前在我的项目中使用过 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');
    }

但还是同样的错误。

我不知道我错过了哪一部分。你能帮帮我吗?

【问题讨论】:

    标签: php codeigniter ion-auth


    【解决方案1】:
    【解决方案2】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-08
      • 1970-01-01
      • 2017-12-04
      • 2012-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-26
      相关资源
      最近更新 更多