@@ -31,17 +31,17 @@ into its appropriate sections::
3131The Current URI
3232---------------
3333
34- Many times, all you really want is an object representing the current URL of this request. This can be accessed
35- in two different ways. The first is to grab it directly from the current request object. Assuming that you're in
36- a controller that extends ``CodeIgniter\Controller `` you can get it like::
37-
38- $uri = $this->request->uri;
39-
40- Second, you can use one of the functions available in the **url_helper **::
34+ Many times, all you really want is an object representing the current URL of this request.
35+ You can use one of the functions available in the **url_helper **::
4136
4237 $uri = current_url(true);
43-
38+
4439You must pass ``true `` as the first parameter, otherwise, it will return the string representation of the current URL.
40+ This URI is based on the path (relative to your ``baseURL ``) as determined by the current request object and
41+ your settings in ``Config\App `` (baseURL, indexPage, and forceGlobalSecureRequests).
42+ Assuming that you're in a controller that extends ``CodeIgniter\Controller `` you can get this relative path::
43+
44+ $path = $this->request->getPath();
4545
4646===========
4747URI Strings
@@ -51,7 +51,7 @@ Many times, all you really want is to get a string representation of a URI. This
5151the URI as a string::
5252
5353 $uri = current_url(true);
54- echo (string)$uri; // http://example.com
54+ echo (string) $uri; // http://example.com/index.php
5555
5656If you know the pieces of the URI and just want to ensure it's all formatted correctly, you can generate a string
5757using the URI class' static ``createURIString() `` method::
0 commit comments