Welcome Guest, Not a member yet? Register   Sign In
practical to autoload libraries like this?
#6

[eluser]wiredesignz[/eluser]
You could try something like this. Just be sure to check how often it is being triggered unnecessarily.

Code:
function __get($name)
{
    $name = ucfirst(strtolower($name));

    if(is_file(BASEPATH.'libraries/'.$name.EXT) OR is_file(APPPATH.'libraries/'.$name.EXT)) {
        $this->load->library($name);
    }
}


Messages In This Thread
practical to autoload libraries like this? - by El Forum - 07-13-2009, 07:25 PM
practical to autoload libraries like this? - by El Forum - 07-13-2009, 08:10 PM
practical to autoload libraries like this? - by El Forum - 07-13-2009, 08:11 PM
practical to autoload libraries like this? - by El Forum - 07-13-2009, 08:14 PM
practical to autoload libraries like this? - by El Forum - 07-13-2009, 08:45 PM
practical to autoload libraries like this? - by El Forum - 07-13-2009, 09:04 PM



Theme © iAndrew 2016 - Forum software by © MyBB