Skip to content

Commit 8c39ef2

Browse files
committed
docs: add description for current_url()
1 parent 7c55240 commit 8c39ef2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

user_guide_src/source/helpers/url_helper.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,20 @@ The following functions are available:
9898
:returns: The current URL
9999
:rtype: string|\\CodeIgniter\\HTTP\\URI
100100

101-
Returns the full URL (including segments) of the page being currently viewed.
101+
Returns the full URL of the page being currently viewed.
102+
When returning string, the query and fragment parts of the URL are removed.
103+
When returning URI, the query and fragment parts are preserved.
102104

103105
However for security reasons, it is created based on the ``Config\App`` settings,
104106
and not intended to match the browser URL.
105107

106108
Since v4.3.0, if you set ``Config\App::$allowedHostnames``,
107109
this returns the URL with the hostname set in it if the current URL matches.
108110

109-
.. note:: Calling this function is the same as doing this:
111+
.. note:: Calling ``current_url()`` is the same as doing this:
110112

111113
.. literalinclude:: url_helper/006.php
114+
:lines: 2-
112115

113116
.. important:: Prior to v4.1.2, this function had a bug causing it to ignore the configuration on ``Config\App::$indexPage``.
114117

0 commit comments

Comments
 (0)