• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.