code: public function isActive(string $url)
      {
          if ($this->makeUrl($url, true) === str_replace($this->uri, '', $_SERVER['REQUEST_URI'])) {
              return true;
          }
  
          return false;
      }
docs: Check current active page
  
  @param string $url
  
  @return bool