From 6dd65269d4ae5dc8fba1b82eca19807cd5cce8b2 Mon Sep 17 00:00:00 2001 From: Ibrahim BinAlshikh Date: Mon, 26 Feb 2024 22:48:41 +0300 Subject: [PATCH 1/4] Refactoring class `Router` --- webfiori/framework/router/Router.php | 206 +++++++++++++-------------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/webfiori/framework/router/Router.php b/webfiori/framework/router/Router.php index 3285bf05..18bec9c7 100644 --- a/webfiori/framework/router/Router.php +++ b/webfiori/framework/router/Router.php @@ -56,8 +56,8 @@ * to it as follows: *
  * Router::addRoute([
- *     'path'=>'/custom-route',
- *     'route-to'=>'/my-files/my-view.html'
+ *     RouteOption::PATH => '/custom-route',
+ *     RouteOption::TO => '/my-files/my-view.html'
* ]); *
*

@@ -66,13 +66,12 @@ * points to classes as follows: *
  * Router::addRoute([
- *     'path'=>'/custom-route',
- *     'route-to'=> MyClass::class
+ *     RouteOption::PATH => '/custom-route',
+ *     RouteOption::TO => MyClass::class
* ]); *
*

* @author Ibrahim - * @version 1.4.0 */ class Router { /** @@ -175,7 +174,8 @@ private function __construct() { /** * Adds new route to a file inside the root folder. * - * @param array $options An associative array of options. Available options + * @param array $options An associative array of options. + * The class 'RouteOption' can be used to access options. Available options * are: *