protected function renderPage($page, $widgetInstances)
    {
        $title = isset($page['title']) ? $page['title'] : '';
        $widgets = array_map(function ($w) {
            return $w->render();
        }, $widgetInstances);
        $banner = $this->banner;
        $page_number = $this->pageNumber;

        if (!isset($page['finish'])) {
            if ($page_number > $this->startPage) $show_back = true;
            if ($page_number < $this->getNumberOfPages() - 1) $show_next = true;
        }
        $prev_page_number = $page_number - 1;
        $messages = $_SESSION['messages'] ?? null;
        unset($_SESSION['messages']);

        require __DIR__ . "/../templates/web/main.tpl.php";
    }