2018-07-14 17:22:28 +02:00
|
|
|
<?php
|
|
|
|
namespace router;
|
|
|
|
|
|
|
|
use core\CoreInterface;
|
2018-07-14 17:48:24 +02:00
|
|
|
use controller\standart\Standart;
|
2018-07-14 17:22:28 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author kevinfrantz
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
final class Router implements RouterInterface
|
|
|
|
{
|
2018-07-14 17:48:24 +02:00
|
|
|
/**
|
|
|
|
* @var CoreInterface
|
|
|
|
*/
|
|
|
|
private $core;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private $get;
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
private $post;
|
|
|
|
|
|
|
|
public function route():void
|
2018-07-14 17:22:28 +02:00
|
|
|
{
|
2018-07-14 17:48:24 +02:00
|
|
|
if($this->post['route']){
|
|
|
|
$this->postRouting();
|
|
|
|
}
|
|
|
|
if($this->get['router']){
|
|
|
|
$this->getRouting();
|
|
|
|
}else{
|
|
|
|
$standart = new Standart($this->core);
|
|
|
|
$standart->homepage();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private function postRouting():void{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private function getRouting():void{
|
|
|
|
|
2018-07-14 17:22:28 +02:00
|
|
|
}
|
|
|
|
|
2018-07-14 17:48:24 +02:00
|
|
|
public function setGet(array $get):void
|
|
|
|
{
|
|
|
|
$this->get = $get;
|
|
|
|
}
|
2018-07-14 17:22:28 +02:00
|
|
|
|
2018-07-14 17:48:24 +02:00
|
|
|
public function setCore(CoreInterface $core):void
|
|
|
|
{
|
|
|
|
$this->core = $core;
|
|
|
|
}
|
2018-07-14 17:22:28 +02:00
|
|
|
|
|
|
|
public function setPost(array $post): void
|
2018-07-14 17:48:24 +02:00
|
|
|
{
|
|
|
|
$this->post = $post;
|
|
|
|
}
|
2018-07-14 17:22:28 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|