From 9dddf13ac1e772fc5e42c85d68893f5425bbe4bc Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 15 Jul 2018 09:11:17 +0200 Subject: [PATCH] Added login and logout forms --- src/controller/user/User.php | 12 +++++++++--- src/router/Router.php | 2 +- src/template/user/login.html.php | 1 - src/template/user/login.html.twig | 16 ++++++++++++++++ src/template/user/register.html.twig | 20 ++++++++++++++++++++ src/template/user/registration.html.php | 1 - 6 files changed, 46 insertions(+), 6 deletions(-) delete mode 100644 src/template/user/login.html.php create mode 100644 src/template/user/login.html.twig create mode 100644 src/template/user/register.html.twig delete mode 100644 src/template/user/registration.html.php diff --git a/src/controller/user/User.php b/src/controller/user/User.php index aed9381..a74e031 100644 --- a/src/controller/user/User.php +++ b/src/controller/user/User.php @@ -1,21 +1,27 @@ render('user/login.html.twig'); + } public function register(): void - {} + { + $this->render('user/register.html.twig'); + } } diff --git a/src/router/Router.php b/src/router/Router.php index 6ea62f8..dcad083 100644 --- a/src/router/Router.php +++ b/src/router/Router.php @@ -43,7 +43,7 @@ final class Router implements RouterInterface if ($this->get) { switch ($this->get[self::CONTROLLER]) { case 'user': - $userController = new User(); + $userController = new User($this->core); switch ($this->get[self::ACTION]) { case 'login': return $userController->login(); diff --git a/src/template/user/login.html.php b/src/template/user/login.html.php deleted file mode 100644 index b3d9bbc..0000000 --- a/src/template/user/login.html.php +++ /dev/null @@ -1 +0,0 @@ -Login +
+
+ + +
+
+ + +
+ +
+{% endblock %} diff --git a/src/template/user/register.html.twig b/src/template/user/register.html.twig new file mode 100644 index 0000000..b1716e4 --- /dev/null +++ b/src/template/user/register.html.twig @@ -0,0 +1,20 @@ +{% extends "frames/default.html.twig" %} +{% block title %}register{% endblock %} +{% block content %} +

Register

+
+
+ + +
+
+ + +
+
+ + +
+ +
+{% endblock %} diff --git a/src/template/user/registration.html.php b/src/template/user/registration.html.php deleted file mode 100644 index b3d9bbc..0000000 --- a/src/template/user/registration.html.php +++ /dev/null @@ -1 +0,0 @@ -