aboutsummaryrefslogtreecommitdiff
path: root/app/model/Navigation.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/model/Navigation.php')
-rw-r--r--app/model/Navigation.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/model/Navigation.php b/app/model/Navigation.php
new file mode 100644
index 0000000..72ee891
--- /dev/null
+++ b/app/model/Navigation.php
@@ -0,0 +1,30 @@
+<?php
+
+class Navigation
+{
+ public function requestContains($route)
+ {
+ if (strpos($_SERVER['REQUEST_URI'], $route) !== false) {
+ return true;
+ }
+ return false;
+ }
+
+ public function isActiveHome()
+ {
+ if ($_SERVER['REQUEST_URI'] === '/') {
+ return 'link-active text-black ';
+ }
+ return;
+ }
+
+ public function isActive($route)
+ {
+ if ($_SERVER['REQUEST_URI'] === $route
+ || $this->requestContains($route)
+ ) {
+ return 'link-active text-black ';
+ }
+ return;
+ }
+}