Skip to content

Commit 7411c64

Browse files
committed
docs: add section titles
1 parent fdef549 commit 7411c64

File tree

1 file changed

+23
-3
lines changed
  • user_guide_src/source/libraries

1 file changed

+23
-3
lines changed

user_guide_src/source/libraries/uri.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,31 +139,51 @@ can be used to manipulate it:
139139
Query
140140
-----
141141

142-
The query variables can be manipulated through the class using simple string representations. Query values can only
142+
The query variables can be manipulated through the class using simple string representations.
143+
144+
Getting/Setting Query
145+
^^^^^^^^^^^^^^^^^^^^^
146+
147+
Query values can only
143148
be set as a string currently.
144149

145150
.. literalinclude:: uri/017.php
146151

152+
The ``setQuery()`` method overwrite any existing query variables.
153+
147154
.. note:: Query values cannot contain fragments. An InvalidArgumentException will be thrown if it does.
148155

156+
Setting Query from Array
157+
^^^^^^^^^^^^^^^^^^^^^^^^
158+
149159
You can set query values using an array:
150160

151161
.. literalinclude:: uri/018.php
152162

153-
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
154169
query variables collection without destroying the existing query variables with the ``addQuery()`` method. The first
155170
parameter is the name of the variable, and the second parameter is the value:
156171

157172
.. literalinclude:: uri/019.php
158173

159-
**Filtering Query Values**
174+
Filtering Query Values
175+
^^^^^^^^^^^^^^^^^^^^^^
160176

161177
You can filter the query values returned by passing an options array to the ``getQuery()`` method, with either an
162178
*only* or an *except* key:
163179

164180
.. literalinclude:: uri/020.php
165181

166182
This 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+
167187
you can use the ``stripQuery()`` and ``keepQuery()`` methods to change the actual object's query variable collection:
168188

169189
.. literalinclude:: uri/021.php

0 commit comments

Comments
 (0)