diff --git a/src/index.php b/src/index.php index 075d1b0..2bcd94b 100644 --- a/src/index.php +++ b/src/index.php @@ -7,7 +7,6 @@ require __DIR__. '/vendor/autoload.php'; $core = new Core(); $router = new Router(); $router->setCore($core); -$router->setPost($_POST); $router->setGet($_GET); $router->route(); ?> diff --git a/src/router/Router.php b/src/router/Router.php index 3b2072c..8a69f50 100644 --- a/src/router/Router.php +++ b/src/router/Router.php @@ -35,7 +35,7 @@ final class Router implements RouterInterface * {@inheritdoc} * @see \router\RouterInterface::route() */ - public function route(): void + public function route() { if ($this->get) { switch ($this->get['controller']) { diff --git a/src/router/RouterInterface.php b/src/router/RouterInterface.php index 3aff324..71ce305 100644 --- a/src/router/RouterInterface.php +++ b/src/router/RouterInterface.php @@ -11,13 +11,7 @@ use core\CoreInterface; interface RouterInterface { public function setCore(CoreInterface $core):void; - - /** - * 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 @@ -26,6 +20,7 @@ interface RouterInterface /** * Opens the controller + * @return mixed */ - public function route():void; + public function route(); } diff --git a/src/router/Url.php b/src/router/Url.php new file mode 100644 index 0000000..f548dd7 --- /dev/null +++ b/src/router/Url.php @@ -0,0 +1,32 @@ +parameters = $parameters; + } + + public function getUrl():string{ + return "index.php".$this->getParameters(); + } + + private function getParameters():string{ + $parameters = '?'; + foreach ($parameters as $key=>$value){ + $parameters .= $key.'='.$value.'&'; + } + } +} +