private static function format($https = null, $asset = false)
    {
        $root = static::base();

        if (!$asset) {
            $root .= '/' . Config::get('app.index');
        }

        // Unless $https is specified we set https for all secure links.
        if (is_null($https)) {
            $https = self::$isHttps;
        }

        // disable SSL on all framework generated links to make it more
        // convenient to work with the site while developing locally.
        if ($https && Config::get('ssl')) {
            return preg_replace('~http://~', 'https://', $root, 1);
        }

        return preg_replace('~https://~', 'http://', $root, 1);
    }