diff --git a/src/Application/Login.php b/src/Application/Login.php new file mode 100644 index 0000000..fbfd8b9 --- /dev/null +++ b/src/Application/Login.php @@ -0,0 +1,35 @@ +get('/login', function ($request, $response, $args) { + // Render index view + return $this->renderer->render($response, 'login.phtml', $args); + }); + $app->post('/login', function ($request, $response, $args) { + // Render index view + + if(isset($_POST["username"])){ + echo "Jouw naam is: " . $_POST["username"] . " en je wachtwoord is: " . $_POST["password"] . "
\n"; + } + $newResponse = $response->withHeader('Location', 'index.php'); + return $this->renderer->render($newResponse, 'login.phtml', $args); + }); + } +} diff --git a/src/bootstrap.php b/src/bootstrap.php index 892723b..25f42f0 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -72,6 +72,7 @@ $container['renderer'] = function ($c) { * */ +new InfD4p\Application\Login($app); new InfD4p\Application\Main($app); /** diff --git a/templates/login.phtml b/templates/login.phtml new file mode 100644 index 0000000..595a861 --- /dev/null +++ b/templates/login.phtml @@ -0,0 +1,56 @@ + + + + + InforBank - Inloggen + + + + + + +
+
+

InforBank

+
+
+
+
+ + + + + + + +
+
+ + + + +