When I load custom model in CodeIgniter3 controller, Display ‘Unable to load the requested class: Inflector’

My controler test.php under application folder:

class Test extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
    }
    function test_model_use()
    {
        $this->load->model('test');
        echo $this->Test_model->test();
    }
}

Model

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

class Test_model extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }

    public function test()
    { 
        return "test";
    }
}

Visit this uri test/test_model_use in browser, It’s show

An Error Was Encountered
Unable to load the requested class: Inflector


Source: php

Leave a Reply