mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 08:53:31 +02:00
update cmd line
This commit is contained in:
parent
67a507d530
commit
8c55f6b749
214 changed files with 48553 additions and 48489 deletions
34
snippets/codeigniter4/docs/VALIDATIONS.md
Normal file
34
snippets/codeigniter4/docs/VALIDATIONS.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
### Alternate Snippets for Validation
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [Alternate Snippets for Validation](#alternate-snippets-for-validation)
|
||||
- [Table of Content](#table-of-content)
|
||||
- [Validation](#validation)
|
||||
- [Validation in Controller](#validation-in-controller)
|
||||
|
||||
### Validation
|
||||
|
||||
#### Validation in Controller
|
||||
|
||||
- Command
|
||||
```code
|
||||
ci4:validation:controller
|
||||
```
|
||||
- Output
|
||||
|
||||
```php
|
||||
$validation = \Config\Services::validation();
|
||||
$rules = [
|
||||
'field_1' => [
|
||||
'label' => 'Field 1 Custom Name',
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => '{field} is required.'
|
||||
]
|
||||
],
|
||||
];
|
||||
if (!$this->validate($rules)) {
|
||||
return redirect()->to('/route')->withInput()->with('validation', $validation);
|
||||
}
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue