Added router draft

This commit is contained in:
Kevin Frantz 2018-07-14 17:22:28 +02:00
parent 67f6ea76eb
commit d1a29b6d70
3 changed files with 72 additions and 0 deletions

13
src/index.php Normal file
View 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
View 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
{}
}

View 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();
}