You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
791 B

  1. <?php
  2. class Load
  3. {
  4. static $models = array();
  5. static $templater = false;
  6. static $router = false;
  7. static function model($model_name)
  8. {
  9. if (isset(self::$models[$model_name])) {
  10. return self::$models[$model_name];
  11. }
  12. $class_name = $model_name.MODEL_POSTFIX;
  13. return self::$models[$model_name] = new $class_name;
  14. }
  15. static function templater($path = '')
  16. {
  17. if (self::$templater) {
  18. if ($path) {
  19. self::$templater->setPath($path);
  20. }
  21. return self::$templater;
  22. }
  23. return self::$templater = new Sublimer($path);
  24. }
  25. static function router()
  26. {
  27. return self::$router ? self::$router : self::$router = new Router;
  28. }
  29. }
  30. ?>