code: public static function getBaseUrl($addPath = false)
      {
          $url = 'http';
          if (self::isSsl()) {
              $url .= 's';
          }
          $url .= '://' . self::getHost();
          if ($addPath) {
              $path = self::getPath();
              if ($path != '') {
                  $url .= '/' . $path;
              }
          }
          return $url;
      }
docs: Get url.
  
  @param boolean $addPath Default false.
  @return string