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.

36 lines
834 B

  1. <?php
  2. /**
  3. *
  4. *
  5. * @copyright
  6. * @link
  7. * @package Majestic
  8. * @subpackage PageController
  9. * @since
  10. * @version SVN: $Id$
  11. * @filesource $URL$
  12. */
  13. final class PageController
  14. {
  15. /**
  16. * Вывод в браузер всего сайта.
  17. *
  18. */
  19. public function display()
  20. {
  21. try {
  22. $this->route = Load::router()->proccess(MJ_PATH);
  23. $decorator = new $this->route->decorator;
  24. return $decorator->display(new $this->route->action);
  25. } catch (MJException $e) {
  26. return $e->terminate();
  27. } catch (Exception $e) {
  28. $decorator_name = DEFAULT_DECORATOR;
  29. $action_name = DEFAULT_ACTION;
  30. $decorator = new $decorator_name;
  31. return $decorator->display(new $action_name($e->getMessage()));
  32. }
  33. }
  34. }
  35. ?>