Skip to content

Commit eda2ff4

Browse files
committed
docs: add note for In-Model Validation
1 parent 5a0f9cb commit eda2ff4

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

user_guide_src/source/helpers/form_helper.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ The following functions are available:
536536
The returned array is the same as ``Validation::getErrors()``.
537537
See :ref:`Validation <validation-redirect-and-validation-errors>` for details.
538538

539+
.. note:: This function does not work with :ref:`in-model-validation`. If you
540+
want to get the validation errors in model validation, see
541+
:ref:`model-getting-validation-errors`.
542+
539543
Example::
540544

541545
<?php $errors = validation_errors(); ?>
@@ -555,6 +559,10 @@ The following functions are available:
555559

556560
This function uses :php:func:`validation_errors()` internally.
557561

562+
.. note:: This function does not work with :ref:`in-model-validation`. If you
563+
want to get the validation errors in model validation, see
564+
:ref:`model-getting-validation-errors`.
565+
558566
Example::
559567

560568
<?= validation_list_errors() ?>
@@ -575,6 +583,10 @@ The following functions are available:
575583

576584
This function uses :php:func:`validation_errors()` internally.
577585

586+
.. note:: This function does not work with :ref:`in-model-validation`. If you
587+
want to get the validation errors in model validation, see
588+
:ref:`model-getting-validation-errors`.
589+
578590
Example::
579591

580592
<?= validation_show_error('username') ?>

user_guide_src/source/models/model.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,8 @@ Cleans out the database table by permanently removing all rows that have 'delete
456456

457457
.. literalinclude:: model/026.php
458458

459+
.. _in-model-validation:
460+
459461
In-Model Validation
460462
===================
461463

@@ -542,6 +544,8 @@ Getting Validation Result
542544
Now, whenever you call the ``insert()``, ``update()``, or ``save()`` methods, the data will be validated. If it fails,
543545
the model will return boolean **false**.
544546

547+
.. _model-getting-validation-errors:
548+
545549
Getting Validation Errors
546550
-------------------------
547551

0 commit comments

Comments
 (0)