diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-10-13 20:45:59 -0400 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-10-13 20:45:59 -0400 |
commit | 20d2adb6f291b8ace71e8a89ed181f73fd78d3ee (patch) | |
tree | e4dfd49a3b9db70267e24f7988df52c6e9ba3f17 /app/model | |
parent | 08f5224df3445274801f57db7553d97386286fb1 (diff) | |
download | thedroneely.com-20d2adb6f291b8ace71e8a89ed181f73fd78d3ee.tar.gz thedroneely.com-20d2adb6f291b8ace71e8a89ed181f73fd78d3ee.tar.bz2 thedroneely.com-20d2adb6f291b8ace71e8a89ed181f73fd78d3ee.zip |
app/model/Navigation: Return boolean on checks
Remove CSS class dependency
Diffstat (limited to 'app/model')
-rw-r--r-- | app/model/Navigation.php | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/app/model/Navigation.php b/app/model/Navigation.php index 1a6b88a..d32546b 100644 --- a/app/model/Navigation.php +++ b/app/model/Navigation.php @@ -4,27 +4,16 @@ class Navigation { public function requestContains($route) { - if (strpos($_SERVER['REQUEST_URI'], $route) !== false) { - return true; - } - return false; + return (bool) (strpos($_SERVER['REQUEST_URI'], $route) !== false); } public function isActiveHome() { - if (strlen(strtok($_SERVER['REQUEST_URI'], '?')) === 1) { - return 'navbar__active '; - } - return; + return (bool) (strlen(strtok($_SERVER['REQUEST_URI'], '?')) === 1); } public function isActive($route) { - if ($_SERVER['REQUEST_URI'] === $route - || $this->requestContains($route) - ) { - return 'navbar__active '; - } - return; + return (bool) ($_SERVER['REQUEST_URI'] === $route || $this->requestContains($route)); } } |