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.
46 lines
1.2 KiB
46 lines
1.2 KiB
<?php
|
|
/**
|
|
*
|
|
*
|
|
* @copyright netmonsters.ru
|
|
* @link
|
|
* @package Majestic
|
|
* @subpackage PageController
|
|
* @since
|
|
* @version SVN: $Id$
|
|
* @filesource $URL$
|
|
*/
|
|
final class PageController
|
|
{
|
|
|
|
/**
|
|
* Вывод в браузер всего сайта.
|
|
*
|
|
*/
|
|
public function display()
|
|
{
|
|
try {
|
|
try{
|
|
$this->route = Load::router()->proccess(MJ_PATH);
|
|
$action = new $this->route->action;
|
|
$decorator = new $this->route->decorator;
|
|
return $decorator->display($action);
|
|
} catch (MJException $e) {
|
|
return $e->terminate();
|
|
}
|
|
} catch (DynamicPageException $e) {
|
|
$decorator_name = DEFAULT_DECORATOR;
|
|
$decorator = new $decorator_name;
|
|
$action_name = $e->getMessage();
|
|
return $decorator->display(new $action_name);
|
|
} catch (StaticPageException $e) {
|
|
$decorator_name = DEFAULT_DECORATOR;
|
|
$decorator = new $decorator_name;
|
|
$action_name = DEFAULT_ACTION;
|
|
return $decorator->display(new $action_name($e->getMessage()));
|
|
} catch (Exception $e) {
|
|
return $e->getMessage();
|
|
}
|
|
}
|
|
}
|
|
?>
|