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.

45 lines
941 B

  1. <?php
  2. /**
  3. *
  4. *
  5. * @copyright netmonsters.ru
  6. * @link
  7. * @package Majestic
  8. * @subpackage Load
  9. * @since
  10. * @version SVN: $Id$
  11. * @filesource $URL$
  12. */
  13. class Load
  14. {
  15. static $models = array();
  16. static $templater = false;
  17. static $router = false;
  18. static function model($model_name)
  19. {
  20. if (isset(self::$models[$model_name])) {
  21. return self::$models[$model_name];
  22. }
  23. $class_name = $model_name.MODEL_POSTFIX;
  24. return self::$models[$model_name] = new $class_name;
  25. }
  26. static function templater($path = '')
  27. {
  28. if (self::$templater) {
  29. if ($path) {
  30. self::$templater->setPath($path);
  31. }
  32. return self::$templater;
  33. }
  34. return self::$templater = new Sublimer($path);
  35. }
  36. static function router()
  37. {
  38. return self::$router ? self::$router : self::$router = new Router;
  39. }
  40. }
  41. ?>