diff options
| author | Asko Nomm <asko@bien.ee> | 2022-03-06 22:48:02 +0100 |
|---|---|---|
| committer | Asko Nomm <asko@bien.ee> | 2022-03-06 22:48:02 +0100 |
| commit | f313168d4b53b32b1ee3ce3e2e9ed749848f6985 (patch) | |
| tree | dc55fed561e6d09ae8a9cd41e4f313d969abd36f /README.md | |
| parent | 49a2e23470c291004f2fb203401408225fb61831 (diff) | |
(MINOR) Implement DateFormatValidator
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -88,6 +88,18 @@ $rules = ['password' => 'required']; $hird = new Hird($fields, $rules); ``` +### 'date-format` + +The `date-format` validator validates the string format of a date, and is registered as the `date-format` rule. It will pass validation if the value is set and the value is in the format specified by the rule. + +```php +use Askonomm\Hird\Hird; + +$fields = ['date' => '2020-09-17']; +$rules = ['date' => 'date-format:Y-m-d']; +$hird = new Hird($fields, $rules); +``` + ## Creating validators You can also create your own validators, or replace existing ones if you're not happy with them. |
