mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-24 09:48:51 +02:00
update
This commit is contained in:
parent
e53a643e3d
commit
1ab37bd478
209 changed files with 79957 additions and 0 deletions
23
my-snippets/codeigniter4/snippets/php_validations.json
Normal file
23
my-snippets/codeigniter4/snippets/php_validations.json
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"Codeigniter4_Validation_Controller": {
|
||||
"prefix": "ci4:validation:controller",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$validation = \\\\Config\\\\Services::validation();",
|
||||
"\\$rules = [",
|
||||
"\t 'field_1' => [",
|
||||
"\t\t'label'\t=> 'Field 1 Custom Name',",
|
||||
"\t\t'rules'\t=> 'required',",
|
||||
"\t\t'errors'\t=> [",
|
||||
"\t\t\t'required'\t=> '{field} is required.'",
|
||||
"\t\t]",
|
||||
"\t],",
|
||||
"];",
|
||||
"if (!\\$this->validate(\\$rules)) {",
|
||||
"\treturn redirect()->to('${1:route}')->withInput()->with('validation', \\$validation);",
|
||||
"}",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Validation in Controller"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue