diff options
Diffstat (limited to 'public/index.php')
| -rw-r--r-- | public/index.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/public/index.php b/public/index.php index 7453506..025c9ec 100644 --- a/public/index.php +++ b/public/index.php @@ -3,6 +3,7 @@ declare(strict_types=1); use DTS\BookmarkRepository; +use DTS\Session; use DTS\Template; use function DTS\Functions\respondAndExit; @@ -10,6 +11,8 @@ require_once(__DIR__.'/../autoload.php'); $config = require_once(__DIR__.'/../config.php'); +$session = Session::getInstance(); + $bookmarks = new BookmarkRepository($config['path_to_repository']); $template = new Template($config['path_to_templates']); @@ -24,6 +27,11 @@ if ($tag !== null) { $bookmarks->sort($sort === 'asc'); -$html = $template->render('index', compact('bookmarks')); +$message = $session->get('message'); + +$html = $template->render('index', compact( + 'bookmarks', + 'message' +)); respondAndExit(200, 'OK', $html); |
