mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2024-12-22 23:25:03 +01:00
Added router draft
This commit is contained in:
parent
67f6ea76eb
commit
d1a29b6d70
13
src/index.php
Normal file
13
src/index.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use router\Router;
|
||||
use core\Core;
|
||||
|
||||
require __DIR__. '/vendor/autoload.php';
|
||||
#phpinfo();
|
||||
$core = new Core();
|
||||
$router = new Router();
|
||||
$router->setCore($core);
|
||||
$router->setPost($_POST);
|
||||
$router->setGet($_GET);
|
||||
$router->route();
|
||||
?>
|
28
src/router/Router.php
Normal file
28
src/router/Router.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace router;
|
||||
|
||||
use core\CoreInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
final class Router implements RouterInterface
|
||||
{
|
||||
public function route()
|
||||
{
|
||||
echo "Hello World!";
|
||||
}
|
||||
|
||||
public function setGet(array $get)
|
||||
{}
|
||||
|
||||
public function setCore(CoreInterface $core)
|
||||
{}
|
||||
|
||||
public function setPost(array $post): void
|
||||
{}
|
||||
|
||||
}
|
||||
|
31
src/router/RouterInterface.php
Normal file
31
src/router/RouterInterface.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace router;
|
||||
|
||||
use core\CoreInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevinfrantz
|
||||
*
|
||||
*/
|
||||
interface RouterInterface
|
||||
{
|
||||
public function setCore(CoreInterface $core);
|
||||
|
||||
/**
|
||||
* Post parameters are used to save data
|
||||
* @param array $post
|
||||
*/
|
||||
public function setPost(array $post): void;
|
||||
|
||||
/**
|
||||
* Get Parameters are used to request Data
|
||||
* @param array $get
|
||||
*/
|
||||
public function setGet(array $get);
|
||||
|
||||
/**
|
||||
* Opens the controller
|
||||
*/
|
||||
public function route();
|
||||
}
|
Loading…
Reference in New Issue
Block a user