Welcome Guest, Not a member yet? Register   Sign In
loading my model to load_class
#2

You understand the logic but maybe not the purpose of this function. Its purpose is to load core classes of the framework and classes that extend core classes. All the core classes are defined using "CI_" as a prefix to the class name. The name of any class that extends a core class must begin with the prefix defined by $config['subclass_prefix']. The filename of extending classes must begin with that prefix too. The default value of  $config['subclass_prefix'] is "MY_".

A workaround you can use is to name your file  and class name using the subclass_prefix.

FILE: APPPATH/libraries/MY_special_model.php
PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
MY_special_model extends CI_Model 
{
 
   //your code

Reply


Messages In This Thread
loading my model to load_class - by Vitaly83 - 10-31-2017, 06:57 AM
RE: loading my model to load_class - by dave friend - 10-31-2017, 08:12 AM
RE: loading my model to load_class - by Narf - 10-31-2017, 09:18 AM
RE: loading my model to load_class - by Vitaly83 - 10-31-2017, 10:31 PM
RE: loading my model to load_class - by Narf - 11-01-2017, 05:05 AM
RE: loading my model to load_class - by Vitaly83 - 11-01-2017, 05:51 AM
RE: loading my model to load_class - by Vitaly83 - 11-02-2017, 02:30 AM
RE: loading my model to load_class - by Narf - 11-02-2017, 03:38 AM
RE: loading my model to load_class - by Vitaly83 - 11-02-2017, 04:12 AM
RE: loading my model to load_class - by Narf - 11-02-2017, 06:15 AM
RE: loading my model to load_class - by Vitaly83 - 11-02-2017, 07:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB