@@ -31,13 +31,14 @@ The Current URI
3131---------------
3232
3333Many times, all you really want is an object representing the current URL of this request.
34- You can use one of the functions available in the ** url_helper ** :
34+ You can use one of the functions available in the :doc: ` ../helpers/ url_helper` :
3535
3636.. literalinclude :: uri/004.php
3737
3838You must pass ``true `` as the first parameter, otherwise, it will return the string representation of the current URL.
39+
3940This URI is based on the path (relative to your ``baseURL ``) as determined by the current request object and
40- your settings in ``Config\App `` (baseURL, indexPage, and forceGlobalSecureRequests).
41+ your settings in ``Config\App `` (`` baseURL ``, `` indexPage `` , and `` forceGlobalSecureRequests `` ).
4142Assuming that you're in a controller that extends ``CodeIgniter\Controller `` you can get this relative path:
4243
4344.. literalinclude :: uri/005.php
@@ -95,7 +96,7 @@ If you do not want to display the port, pass in ``true`` as the only parameter:
9596
9697.. note :: If the current port is the default port for the scheme it will never be displayed.
9798
98- Userinfo
99+ UserInfo
99100--------
100101
101102The userinfo section is simply the username and password that you might see with an FTP URI. While you can get
@@ -138,31 +139,51 @@ can be used to manipulate it:
138139Query
139140-----
140141
141- The query variables can be manipulated through the class using simple string representations. Query values can only
142+ The query data can be manipulated through the class using simple string representations.
143+
144+ Getting/Setting Query
145+ ^^^^^^^^^^^^^^^^^^^^^
146+
147+ Query values can only
142148be set as a string currently.
143149
144150.. literalinclude :: uri/017.php
145151
152+ The ``setQuery() `` method overwrite any existing query variables.
153+
146154.. note :: Query values cannot contain fragments. An InvalidArgumentException will be thrown if it does.
147155
156+ Setting Query from Array
157+ ^^^^^^^^^^^^^^^^^^^^^^^^
158+
148159You can set query values using an array:
149160
150161.. literalinclude :: uri/018.php
151162
152- The ``setQuery() `` and ``setQueryArray() `` methods overwrite any existing query variables. You can add a value to the
163+ The ``setQueryArray() `` method overwrite any existing query variables.
164+
165+ Adding Query Value
166+ ^^^^^^^^^^^^^^^^^^
167+
168+ You can add a value to the
153169query variables collection without destroying the existing query variables with the ``addQuery() `` method. The first
154170parameter is the name of the variable, and the second parameter is the value:
155171
156172.. literalinclude :: uri/019.php
157173
158- **Filtering Query Values **
174+ Filtering Query Values
175+ ^^^^^^^^^^^^^^^^^^^^^^
159176
160177You can filter the query values returned by passing an options array to the ``getQuery() `` method, with either an
161178*only * or an *except * key:
162179
163180.. literalinclude :: uri/020.php
164181
165182This only changes the values returned during this one call. If you need to modify the URI's query values more permanently,
183+
184+ Changing Query Values
185+ ^^^^^^^^^^^^^^^^^^^^^
186+
166187you can use the ``stripQuery() `` and ``keepQuery() `` methods to change the actual object's query variable collection:
167188
168189.. literalinclude :: uri/021.php
@@ -174,7 +195,7 @@ you can use the ``stripQuery()`` and ``keepQuery()`` methods to change the actua
174195Fragment
175196--------
176197
177- Fragments are the portion at the end of the URL, preceded by the pound-sign (# ). In HTML URLs these are links
198+ Fragments are the portion at the end of the URL, preceded by the pound-sign (`` # `` ). In HTML URLs these are links
178199to an on-page anchor. Media URI's can make use of them in various other ways.
179200
180201.. literalinclude :: uri/022.php
0 commit comments