Skip to content

Commit 28f4a70

Browse files
authored
Update README.md
1 parent 8dbfb43 commit 28f4a70

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,21 @@ class ExampleController extends Controller {
5252
}
5353
// validation success
5454
}
55+
// or short
56+
public function indexAction() {
57+
$arMessages = Validation::make($_POST, [
58+
'email' => [Validation::required(), Validation::email()],
59+
'num' => [Validation::required(), Validation::numeric()],
60+
]);
61+
if ($arMessages) {
62+
// validation error
63+
}
64+
// validation success
65+
}
5566
}
5667
```
5768

69+
5870
```php
5971

6072
/*

0 commit comments

Comments
 (0)