Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. spl_autoload_register(function($class)
  2. {
  3. $class = explode('\\', $class);
  4. $class = array_pop($class);
  5. $pathApp = 'application'.DS.$class.'.class.php';
  6. $pathControllers = 'controllers'.DS.$class.'.class.php';
  7. $pathModels = 'models'.DS.$class.'.class.php';
  8.  
  9. if (file_exists($pathApp))
  10. {
  11. require_once($pathApp);
  12. }
  13. elseif (file_exists($pathControllers))
  14. {
  15. require_once($pathControllers);
  16. }
  17. elseif (file_exists($pathModels))
  18. {
  19. require_once($pathModels);
  20. }
  21. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement