mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 08:35:48 +02:00
23 lines
No EOL
813 B
JSON
23 lines
No EOL
813 B
JSON
{
|
|
"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"
|
|
}
|
|
} |