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.

26 lines
690 B

  1. <?php
  2. final class PageController
  3. {
  4. /**
  5. * Вывод в браузер всего сайта.
  6. *
  7. */
  8. public function display()
  9. {
  10. try {
  11. $this->route = Load::router()->proccess(MJ_PATH);
  12. $decorator = new $this->route->decorator;
  13. return $decorator->display(new $this->route->action);
  14. } catch (MJException $e) {
  15. return $e->terminate();
  16. } catch (Exception $e) {
  17. $decorator_name = DEFAULT_DECORATOR;
  18. $action_name = DEFAULT_ACTION;
  19. $decorator = new $decorator_name;
  20. return $decorator->display(new $action_name($e->getMessage()));
  21. }
  22. }
  23. }
  24. ?>