From ac5148995e3c9cb5857b034800fbe29205cb102d Mon Sep 17 00:00:00 2001 From: Tom Breese Date: Sat, 13 Oct 2018 13:06:00 -0400 Subject: [PATCH] usage-docs; adding dot notation usage --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index a7d2344..9eb0f82 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,19 @@ if($v->validate()) { } ``` +You can also access nested values using dot notation: + +```php +$v = new Valitron\Validator(array('user' => array('first_name' => 'Steve', 'last_name' => 'Smith', 'username' => 'Batman123'))); +$v->rule('alpha', 'user.first_name')->rule('alpha', 'user.last_name')->rule('alphaNum', 'user.username'); +if($v->validate()) { + echo "Yay! We're all good!"; +} else { + // Errors + print_r($v->errors()); +} +``` + Setting language and language dir globally: ```php