Codeigniter autoload


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function __autoload($class)
  2. {
  3. if (strpos($class, 'CI_') !== 0)
  4. {
  5. if (is_file($location = APPPATH.'libraries/'.$class.EXT))
  6. {
  7. include_once $location;
  8. }
  9. else if (is_file($location = APPPATH.'core/'.$class.EXT))
  10. {
  11. include_once $location;
  12. }
  13. }
  14. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.