if (!empty(self::$callback))
return self::$callback;
}
}
}
// Якщо не знайдено співпадінь то видаємо виключення що сторінку не знайдено
if (!$is_found)
throw new NotFoundHttpException('Page not found');
}
// Get callback from routing list
private function getCallback(array $options)
{
if (!empty($options['middleware'])) {
foreach ($options['middleware'] as $class => $opt) {
$middleware = new $class();
function run()
{
// Set ErrorHandler
$eHandler = new ErrorHandler();
$eHandler->register();
echo RouteManager::route(SiteBuilder::$app->route, $_SERVER['REQUEST_URI']);
}
}
require_once __DIR__ .'/vendor/sitebuilder/autoload.php'; $config = require_once (__DIR__ .'/config/config.php'); \app\sitebuilder\SiteBuilder::$app = new Application($config); \app\sitebuilder\SiteBuilder::$app->run();