public function makePage($makePageFunction, $autoConnectTemplate = true) { try { $this->checkPageFunction($makePageFunction); if (!$this->_pageIsCallable) { throw new AppErrorException(__METHOD__ . 'Страница не является функцией'); } if ($this->_pageFunctionAlreadyCreated) { throw new AppErrorException(__METHOD__ . 'Нельзя создать одну страницу больше одного раза :)'); } $this->_pageFunctionAlreadyCreated = true; $this->addCSS(CORE_PATH . '/css/base.css'); $this->addCSS(CORE_PATH . '/css/visual.css'); $this->addCSS(CORE_PATH . '/css/ui-sui.css'); $this->addJS(CORE_PATH . '/js/jquery/jquery.js'); $this->addJS(CORE_PATH . '/js/jquery/plugins/jquery-ui.js'); $this->addJS(CORE_PATH . '/js/jquery/plugins/jquery.ba-hashchange.js'); $this->addJS(CORE_PATH . '/js/visual.js'); $this->addJS(CORE_PATH . '/js/core.js'); $this->setProperty('__SYSTEM_IMPORTANT_JAVASCRIPT__', '' . '<script type="text/javascript">' . 'SACID.Components.ob_POST = ' . json_encode($_POST, JSON_FORCE_OBJECT) . ';' . '</script>'); if (APP_DISPLAY_MODE == 'EDIT') { ComponentTools::setCurrentFileName('application_template'); } if ($autoConnectTemplate) { $this->connectTemplate($this->_templateName); } } catch (AppException $except) { $except->catchException(); } // Это место можно считать окончаничем работы системы. Востанавливаем обработчик ошибок ErrorHandlers::restoreErrorHandler(); // Опционально можем вообще останавливать после отрботки. if (defined('PAGE_FINISH_STREAM') && PAGE_FINISH_STREAM === true) { exit; } }