From 85a158c435c1403ede5f59fbc5a38b759f946140 Mon Sep 17 00:00:00 2001 From: Jay Potter Date: Fri, 14 Aug 2026 18:16:40 -0400 Subject: [PATCH] add Bootstrap --- src/Potter/Bootstrap.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/Potter/Bootstrap.php diff --git a/src/Potter/Bootstrap.php b/src/Potter/Bootstrap.php new file mode 100644 index 0000000..049444e --- /dev/null +++ b/src/Potter/Bootstrap.php @@ -0,0 +1,31 @@ + ['application/javascript; charset=utf-8']]); + } + + static private function getBootstrapStyle(ServerRequestInterface $request): ResponseInterface + { + return new Text( + text: file_get_contents(getcwd() . '/vendor/twbs/bootstrap/dist/jss/bootstrap.js'), + headers: ['Content-Type' => ['text/css; charset=utf-8']]); + } + + static private function mapRoutes(Container $container, \Potter\Router\Router $router): void + { + $router->map('GET', '/bootstrap.js', [self::class, 'getBootstrapScript']); + $router->map('GET', '/bootstrap.css', [self::class, 'getBootstrapStyle']); + } +}