code: protected function buildUrl($path = false, array $options = array()) {
          $isAbsolute = (is_array($path) ? $path[0][0] : $path[0]) === '/';
          $url = $isAbsolute || null === $this->index ? '' : "/" . $this->index;
  
          if ($path && is_array($path) && count($path) > 0)
              $url .= "/" . implode("/", array_filter($path));
          if (substr($url, -1) == "/")
              $url = substr($url, 0, -1);
          if (count($options) > 0)
            $url .= "?" . http_build_query($options, '', '&');
  
          return $url;
      }
docs: Build a callable url
  
  @return string
  @param array|bool $path
  @param array $options Query parameter options to pass