mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-21 16:39:04 +02:00
update
This commit is contained in:
parent
e53a643e3d
commit
1ab37bd478
209 changed files with 79957 additions and 0 deletions
113
my-snippets/codeigniter4/snippets/html_views.json
Normal file
113
my-snippets/codeigniter4/snippets/html_views.json
Normal file
|
@ -0,0 +1,113 @@
|
|||
{
|
||||
"Codeigniter4_VIEWS_ENDSECTION": {
|
||||
"prefix": "ci4:views:endSection",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->endSection() ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make end Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_EXTEND": {
|
||||
"prefix": "ci4:views:extend",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->extend('${1:layouts}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Using Layouts in Views"
|
||||
},
|
||||
"Codeigniter4_VIEWS_FOREACH": {
|
||||
"prefix": "ci4:views:foreach",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php foreach (${1:\\$items} as ${2:\\$item}) : ?>",
|
||||
"\t<${3:li}><?= ${4:\\$item}['${5:id}'] ?></${3:li}>",
|
||||
"<?php endforeach ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make foreach in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF": {
|
||||
"prefix": "ci4:views:if",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if (${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSE": {
|
||||
"prefix": "ci4:views:if-else",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if (${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php else : ?>",
|
||||
"\t${3:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if else in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSEIF": {
|
||||
"prefix": "ci4:views:if-elseif",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if(${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php elseif (${3:condition}) : ?>",
|
||||
"\t${4:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if elseif in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSEIF_ELSE": {
|
||||
"prefix": "ci4:views:if-elseif-else",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if(${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE 1 -->}",
|
||||
"<?php elseif (${3:condition}) : ?>",
|
||||
"\t${4:<!-- TRUE 2 -->}",
|
||||
"<?php else : ?>",
|
||||
"\t${5:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - make if elseif else in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_INCLUDE": {
|
||||
"prefix": "ci4:views:include",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->include('${1:sidebar}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Including View Partials"
|
||||
},
|
||||
"Codeigniter4_VIEWS_PHP": {
|
||||
"prefix": "ci4:views:php",
|
||||
"lang": ["html"],
|
||||
"body": ["<?php ${1:code} ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make php tag in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_PHP_ECHO": {
|
||||
"prefix": "ci4:views:php-echo",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= ${1:code} ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make php echo tag in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_RENDERSECTION": {
|
||||
"prefix": "ci4:views:renderSection",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->renderSection('${1:content}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make render Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_SECTION": {
|
||||
"prefix": "ci4:views:section",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->section('${1:content}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_SECTION_ENDSECTION": {
|
||||
"prefix": "ci4:views:section-endSection",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?= \\$this->section('${1:content}') ;?>",
|
||||
"${2:<!-- CODE HERE -->}",
|
||||
"<?= \\$this->endSection() ;?>",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Section with end Section in View files"
|
||||
}
|
||||
}
|
118
my-snippets/codeigniter4/snippets/php_controllers.json
Normal file
118
my-snippets/codeigniter4/snippets/php_controllers.json
Normal file
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
"Codeigniter4_Controller": {
|
||||
"prefix": "ci4:controller",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function ${1:index}(${2:\\$request})",
|
||||
"{",
|
||||
"\t\\\\${3:code}",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller"
|
||||
},
|
||||
"Codeigniter4_Controller_Resources": {
|
||||
"prefix": "ci4:controller:resources",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function __construct()",
|
||||
"{",
|
||||
"\t\\\\__construct code",
|
||||
"}",
|
||||
"",
|
||||
"public function index()",
|
||||
"{",
|
||||
"\t\\\\index code",
|
||||
"}",
|
||||
"",
|
||||
"public function show(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\show code",
|
||||
"}",
|
||||
"",
|
||||
"public function new()",
|
||||
"{",
|
||||
"\t\\\\new code",
|
||||
"}",
|
||||
"",
|
||||
"public function create()",
|
||||
"{",
|
||||
"\t\\\\create code",
|
||||
"}",
|
||||
"",
|
||||
"public function edit(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\edit code",
|
||||
"}",
|
||||
"",
|
||||
"public function update(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\update code",
|
||||
"}",
|
||||
"",
|
||||
"public function delete(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\delete code",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller Resources"
|
||||
},
|
||||
"Codeigniter4_Controller_Presenter": {
|
||||
"prefix": "ci4:controller:presenter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function __construct()",
|
||||
"{",
|
||||
"\t\\__construct code",
|
||||
"}",
|
||||
"",
|
||||
"public function index()",
|
||||
"{",
|
||||
"\t\\index code",
|
||||
"}",
|
||||
"",
|
||||
"public function show(\\$id = null)",
|
||||
"{",
|
||||
"\t\\show code",
|
||||
"}",
|
||||
"",
|
||||
"public function new()",
|
||||
"{",
|
||||
"\t\\new code",
|
||||
"}",
|
||||
"",
|
||||
"public function create()",
|
||||
"{",
|
||||
"\t\\create code",
|
||||
"}",
|
||||
"",
|
||||
"public function edit(\\$id = null)",
|
||||
"{",
|
||||
"\t\\edit code",
|
||||
"}",
|
||||
"",
|
||||
"public function update(\\$id = null)",
|
||||
"{",
|
||||
"\t\\update code",
|
||||
"}",
|
||||
"",
|
||||
"public function remove(\\$id = null)",
|
||||
"{",
|
||||
"\t\\remove code",
|
||||
"}",
|
||||
"",
|
||||
"public function delete(\\$id = null)",
|
||||
"{",
|
||||
"\t\\delete code",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controler Presenter"
|
||||
},
|
||||
"Codeigniter4_Controller_Request": {
|
||||
"prefix": "ci4:controller:request",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$this->request->${1|getVar,getGet,getPost,getMethod,isAjax,isCLI,isSecure|}('${2:field name}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller Request Class"
|
||||
}
|
||||
}
|
165
my-snippets/codeigniter4/snippets/php_migrations.json
Normal file
165
my-snippets/codeigniter4/snippets/php_migrations.json
Normal file
|
@ -0,0 +1,165 @@
|
|||
{
|
||||
"Codeigniter4_Migration": {
|
||||
"prefix": "ci4:migration",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App\\\\Database\\\\Migrations;",
|
||||
"",
|
||||
"use CodeIgniter\\\\Database\\\\Migration;",
|
||||
"",
|
||||
"class ${1:AddBlog} extends Migration",
|
||||
"{",
|
||||
"\tpublic function up()",
|
||||
"\t{",
|
||||
"\t\t$2",
|
||||
"\t}",
|
||||
"",
|
||||
"\tpublic function down()",
|
||||
"\t{",
|
||||
"\t\t$3",
|
||||
"\t}",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration"
|
||||
},
|
||||
"Codeigniter4_Migration_Up": {
|
||||
"prefix": "ci4:migration:up",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function up()",
|
||||
"{",
|
||||
"\t\\$this->forge->addField([",
|
||||
"\t\t'${1:id}' => [",
|
||||
"\t\t\t'type' => 'INT',",
|
||||
"\t\t\t'constraint' => 11,",
|
||||
"\t\t\t'unsigned' => true,",
|
||||
"\t\t\t'auto_increment' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'${2:name}' => [",
|
||||
"\t\t\t'type' => 'VARCHAR',",
|
||||
"\t\t\t'constraint' => 255,",
|
||||
"\t\t],",
|
||||
"\t\t'created_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'updated_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'deleted_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t]);",
|
||||
"\t\\$this->forge->addKey('${1:id}', true);",
|
||||
"\t\\$this->forge->createTable('${3:tableName}');",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Up"
|
||||
},
|
||||
"Codeigniter4_Migration_Down": {
|
||||
"prefix": "ci4:migration:down",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function down()",
|
||||
"{",
|
||||
"\t\\$this->forge->dropTable('${1:tableName}');",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Down"
|
||||
},
|
||||
"Codeigniter4_Migration_BIGINT": {
|
||||
"prefix": "ci4:migration:bigint",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'BIGINT',",
|
||||
"\t'constraint' => 20,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (BIG INTEGER)"
|
||||
},
|
||||
"Codeigniter4_Migration_CHAR": {
|
||||
"prefix": "ci4:migration:char",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'CHAR',",
|
||||
"\t'constraint' => 10,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (CHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_DATETIME": {
|
||||
"prefix": "ci4:migration:datetime",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (CHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_INT": {
|
||||
"prefix": "ci4:migration:int",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'INT',",
|
||||
"\t'constraint' => 11,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (INTEGER)"
|
||||
},
|
||||
"Codeigniter4_Migration_VARCHAR": {
|
||||
"prefix": "ci4:migration:varchar",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'VARCHAR',",
|
||||
"\t'constraint' => 255,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (VARCHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_ID": {
|
||||
"prefix": "ci4:migration:id",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'id' => [",
|
||||
"\t'type' => 'INT',",
|
||||
"\t'constraint' => 11,",
|
||||
"\t'unsigned' => true,",
|
||||
"\t'auto_increment' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration ID"
|
||||
},
|
||||
"Codeigniter4_Migration_Timestamp": {
|
||||
"prefix": "ci4:migration:timestamp",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'created_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],",
|
||||
"'updated_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],",
|
||||
"'deleted_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Timestamp"
|
||||
}
|
||||
}
|
28
my-snippets/codeigniter4/snippets/php_models.json
Normal file
28
my-snippets/codeigniter4/snippets/php_models.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"Codeigniter4_Model_Config": {
|
||||
"prefix": "ci4:model:config",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"protected \\$table = '${1:tableName}';",
|
||||
"protected \\$primaryKey = '${2:id}';",
|
||||
"",
|
||||
"protected \\$useAutoIncrement = ${3:true};",
|
||||
"",
|
||||
"protected \\$returnType = '${4:array}';",
|
||||
"protected \\$useSoftDeletes = ${5:false};",
|
||||
"",
|
||||
"protected \\$allowedFields = ['${6:name}'];",
|
||||
"",
|
||||
"protected \\$useTimestamps = ${7:true};",
|
||||
"protected \\$createdField = '${8:created_at}';",
|
||||
"protected \\$updatedField = '${9:updated_at}';",
|
||||
"protected \\$useTimestamps = '${10:deleted_at}';",
|
||||
"",
|
||||
"protected \\$validationRules = ${11:[]};",
|
||||
"protected \\$validationMessages = ${12:[]};",
|
||||
"protected \\$skipValidation = ${13:false};",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Model Configuring"
|
||||
}
|
||||
}
|
129
my-snippets/codeigniter4/snippets/php_routes.json
Normal file
129
my-snippets/codeigniter4/snippets/php_routes.json
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
"Codeigniter4_ROUTES_ADD": {
|
||||
"prefix": "ci4:routes:add",
|
||||
"lang": ["php"],
|
||||
"body": ["\\$routes->add('${1:url}','${2:ControllerName}::${3:index}');$0"],
|
||||
"description": "CodeIgniter 4 - Make Routes add()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_CLI": {
|
||||
"prefix": "ci4:routes:cli",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->cli('${1:migrate}','${2:App\\\\Database}::${3:migrate}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Command-Line only Routes"
|
||||
},
|
||||
"Codeigniter4_ROUTES_ENVIRONMENT": {
|
||||
"prefix": "ci4:routes:env",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->environment('${1:development}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->add('${2:builder}','${3:Tools\\\\Builder}::${4:index}');",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Environment"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GET": {
|
||||
"prefix": "ci4:routes:get",
|
||||
"lang": ["php"],
|
||||
"body": ["\\$routes->get('${1:url}','${2:ControllerName}::${3:index}');$0"],
|
||||
"description": "CodeIgniter 4 - Make Routes get()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP": {
|
||||
"prefix": "ci4:routes:group",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:admin}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->add('${2:url}','${3:ControllerName}::${4:index};')",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_FILTER": {
|
||||
"prefix": "ci4:routes:group-filter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:api}',['filter' => '${2:api-auth}'], function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->resource('${3:url}');",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() filter"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_MULTIPLE": {
|
||||
"prefix": "ci4:routes:group-multiple",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:admin}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->group('${2:users}', function(\\$routes)",
|
||||
"\t{",
|
||||
"\t\t\\${3:// Route}",
|
||||
"\t});",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() multiple"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_NAMESPACE": {
|
||||
"prefix": "ci4:routes:group-namespace",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:api}',['namespace' => '${2:App\\\\API\\\\v1}'], function(\\$routes)",
|
||||
"{",
|
||||
"\t\\${3://Route}",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() namespace"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PLACEHOLDER": {
|
||||
"prefix": "ci4:routes:placeholder",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->${1|add,get,post,put,delete|}('${2:url}/(:${3|any,segment,num,alpha,alphanum,hash|})','${4:ControllerName}::${5:index}/\\$1');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Placeholder (:any) (:segment) (:num) (:alpha) (:alphanum) (:hash)"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PLACEHOLDER_CUSTOM": {
|
||||
"prefix": "ci4:routes:placeholder:custom",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->addPlaceholder('${1:uuid}', '${2:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}');",
|
||||
"\\$routes->${3|add,get,post,put,delete|}('${4:url}/(:${1:uuid})','${5:ControllerName}::${6:index}/\\$1');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Custom Placeholder default (:uuid)"
|
||||
},
|
||||
"Codeigniter4_ROUTES_POST": {
|
||||
"prefix": "ci4:routes:post",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->post('${1:url}','${2:ControllerName}::${3:index}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes post()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PRESENTER": {
|
||||
"prefix": "ci4:routes:presenter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->presenter('${1:url}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes presenter()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_RESOURCE": {
|
||||
"prefix": "ci4:routes:resource",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->resource('${1:url}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes resource()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_SUBDOMAIN": {
|
||||
"prefix": "ci4:routes:subdomain",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->add('${1:from}', '${2:to}', ['subdomain' => '${2:*}']);$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Limit to Subdomains"
|
||||
}
|
||||
}
|
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