mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2024-12-22 23:25:03 +01:00
Added login and logout forms
This commit is contained in:
parent
c67078f88f
commit
9dddf13ac1
@ -1,21 +1,27 @@
|
||||
<?php
|
||||
namespace controller\user;
|
||||
|
||||
use controller\AbstractDefaultController;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
final class User implements UserInterface
|
||||
final class User extends AbstractDefaultController implements UserInterface
|
||||
{
|
||||
public function logout(): void
|
||||
{}
|
||||
|
||||
public function login(): void
|
||||
{}
|
||||
{
|
||||
$this->render('user/login.html.twig');
|
||||
}
|
||||
|
||||
public function register(): void
|
||||
{}
|
||||
{
|
||||
$this->render('user/register.html.twig');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -1 +0,0 @@
|
||||
<?php
|
16
src/template/user/login.html.twig
Normal file
16
src/template/user/login.html.twig
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends "frames/default.html.twig" %}
|
||||
{% block title %}login{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Login</h1>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputPassword1">Password</label>
|
||||
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endblock %}
|
20
src/template/user/register.html.twig
Normal file
20
src/template/user/register.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends "frames/default.html.twig" %}
|
||||
{% block title %}register{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Register</h1>
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Email address</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputEmail1">Username</label>
|
||||
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter Username">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="exampleInputPassword1">Password</label>
|
||||
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
{% endblock %}
|
@ -1 +0,0 @@
|
||||
<?php
|
Loading…
Reference in New Issue
Block a user