diff options
| author | Asko Nõmm <asko@repl.ee> | 2023-09-26 22:29:48 +0300 |
|---|---|---|
| committer | Asko Nõmm <asko@repl.ee> | 2023-09-26 22:29:48 +0300 |
| commit | 142114a26452c33bbd41083be308cf8a0a3d5a2e (patch) | |
| tree | 4156451e3b26240b9fa629c2c6b875467753de97 /README.md | |
| parent | 641826a5a408b00a6adb04847d178925bbe0e574 (diff) | |
Implement `addError`
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -56,6 +56,16 @@ You can use `$hird->setFieldNames` to overwrite the field names for use within t $hird->setFieldNames(['email' => 'E-mail']); ``` +#### Manually add an error + +In some cases you want to use the same validator provided error messages, but want to mix-match them with validations you do outside of Hird. Well, for that you can use the `addError` method, like so: + +```php +$hird->addError("My error message goes here"); +``` + +Which will prompt Hird validation to fail and show that error message. + ## Built-in validators There are a number of built-in validators available for use by default. If you want to remove a built-in validator, you can remove one using the `$hird->removeValidator('rule-name')` method. |
