@@ -20,9 +20,9 @@ The following functions are available:
2020
2121.. php :function :: site_url([$uri = ''[, $protocol = null[, $altConfig = null]]])
2222
23- :param array|string $uri: URI string or array of URI segments
24- :param string $protocol: Protocol, e.g., 'http' or 'https'
25- :param \\ Config\\ App $altConfig: Alternate configuration to use
23+ :param array|string $uri: URI string or array of URI segments.
24+ :param string $protocol: Protocol, e.g., 'http' or 'https'. If empty string '' is set, a protocol-relative link is returned.
25+ :param \\ Config\\ App $altConfig: Alternate configuration to use.
2626 :returns: Site URL
2727 :rtype: string
2828
@@ -56,8 +56,8 @@ The following functions are available:
5656
5757.. php :function :: base_url([$uri = ''[, $protocol = null]])
5858
59- :param array|string $uri: URI string or array of URI segments
60- :param string $protocol: Protocol, e.g., 'http' or 'https'
59+ :param array|string $uri: URI string or array of URI segments.
60+ :param string $protocol: Protocol, e.g., 'http' or 'https'. If empty string '' is set, a protocol-relative link is returned.
6161 :returns: Base URL
6262 :rtype: string
6363
@@ -83,6 +83,11 @@ The following functions are available:
8383 The above example would return something like:
8484 **http://example.com/blog/post/123 **
8585
86+ If you pass an empty string ``'' `` as the second parameter, it returns
87+ the protocol-relative link:
88+
89+ .. literalinclude :: url_helper/026.php
90+
8691 This is useful because unlike :php:func: `site_url() `, you can supply a
8792 string to a file, such as an image or stylesheet. For example:
8893
0 commit comments