Skip to content

Commit 0ce37d5

Browse files
committed
docs: add note for Validation::withRequest()
1 parent 5df0836 commit 0ce37d5

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

user_guide_src/source/incoming/incomingrequest.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ With CodeIgniter's built-in methods you can simply do this:
8080

8181
.. literalinclude:: incomingrequest/008.php
8282

83+
.. _incomingrequest-getting-data:
84+
8385
Getting Data
8486
============
8587

@@ -103,6 +105,8 @@ maintaining the ability to control the order you look for it:
103105
* ``$request->getPostGet()`` - checks ``$_POST`` first, then ``$_GET``
104106
* ``$request->getGetPost()`` - checks ``$_GET`` first, then ``$_POST``
105107

108+
.. _incomingrequest-getting-json-data:
109+
106110
Getting JSON Data
107111
=================
108112

@@ -138,6 +142,8 @@ correct ``Content-Type`` header.
138142

139143
.. note:: See the documentation for :php:func:`dot_array_search()` in the ``Array`` helper for more information on "dot" notation.
140144

145+
.. _incomingrequest-retrieving-raw-data:
146+
141147
Retrieving Raw Data (PUT, PATCH, DELETE)
142148
========================================
143149

user_guide_src/source/libraries/validation.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,15 @@ data to be validated:
286286

287287
.. literalinclude:: validation/008.php
288288

289+
.. note:: This method gets JSON data from
290+
:ref:`$request->getJSON() <incomingrequest-getting-json-data>`
291+
when the request is a JSON request (``Content-Type: application/json``),
292+
or gets Raw data from
293+
:ref:`$request->getRawInput() <incomingrequest-retrieving-raw-data>`
294+
when the request is a PUT, PATCH, DELETE request and
295+
is not HTML form post (``Content-Type: multipart/form-data``),
296+
or gets data from :ref:`$request->getVar() <incomingrequest-getting-data>`.
297+
289298
Working with Validation
290299
***********************
291300

0 commit comments

Comments
 (0)