This commit is contained in:
asep komarudin 2023-01-15 00:19:37 +07:00
parent e53a643e3d
commit 1ab37bd478
209 changed files with 79957 additions and 0 deletions

View 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"
}
}