Welcome Guest, Not a member yet? Register   Sign In
loading user libraries question?

I was having a problem comprehending loading user classes and Have been using this in my libraries folder, It is just a simple autoload function and gets included in the index.file of the application i.e. /public_html/index.php
I am only using it on a development server but it seems to do what I want.
// file location application/libraries/Autoload.php
function classLoader($class)
    $file = str_replace('_', '/', $class) . '.php';
    if(is_file(dirname(__FILE__) . DIRECTORY_SEPARATOR . $file)){
        include $file;
on public_html/index.php
include APPPATH.'libraries/Autoload.php';
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
I use this because basically I didn't feel like renaming all my classes. If their is something wrong with this method please advise?

Theme © iAndrew 2016 - Forum software by © MyBB