File tree Expand file tree Collapse file tree
user_guide_src/source/libraries Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,6 +344,21 @@ data to be validated:
344344Working with Validation
345345***********************
346346
347+ Running Validation
348+ ==================
349+
350+ The ``run() `` method runs validation. It has the method signature::
351+
352+ run(?array $data = null, ?string $group = null, ?string $dbGroup = null): bool
353+
354+ The ``$data `` is an array of data to validate. The optional second parameter
355+ ``$group `` is the :ref: `predefined group of rules <validation-array >` to apply.
356+ The optional third parameter ``$dbGroup `` is the database group to use.
357+
358+ This method returns true if the validation is successful.
359+
360+ .. literalinclude :: validation/043.php
361+
347362Validating 1 Value
348363==================
349364
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ if (! $ validation ->run ($ data )) {
4+ // handle validation errors
5+ }
6+ // or
7+ if (! $ validation ->run ($ data , 'signup ' )) {
8+ // handle validation errors
9+ }
You can’t perform that action at this time.
0 commit comments