Skip to content

Commit

Permalink
Merge pull request #8154 from kenjis/docs-fix-validation.rst
Browse files Browse the repository at this point in the history
docs: fix validation.rst
  • Loading branch information
kenjis authored Nov 6, 2023
2 parents ab1c0c0 + 75907cf commit ff931e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions user_guide_src/source/libraries/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ To give a labeled error message you can set up as:
.. literalinclude:: validation/007.php
:lines: 2-

.. _validation-withrequest:

.. note:: ``setRules()`` will overwrite any rules that were set previously. To add more than one
rule to an existing set of rules, use ``setRule()`` multiple times.

Expand Down Expand Up @@ -340,6 +338,8 @@ For example, data returned by multi select dropdown:
.. literalinclude:: validation/011.php
:lines: 2-

.. _validation-withrequest:

withRequest()
=============

Expand Down
3 changes: 2 additions & 1 deletion user_guide_src/source/libraries/validation/008.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
$request = \Config\Services::request();

if ($validation->withRequest($request)->run()) {
// If you want to get the validated data.
// If you use the input data, you should get it from the getValidated() method.
// Otherwise you may create a vulnerability.
$validData = $validation->getValidated();

// ...
Expand Down

0 comments on commit ff931e2

Please sign in to comment.