update cmd line

This commit is contained in:
asep komarudin 2023-03-03 07:09:50 +07:00
parent 67a507d530
commit 8c55f6b749
214 changed files with 48553 additions and 48489 deletions

View file

@ -5,6 +5,7 @@
"bufdelete.nvim": { "branch": "master", "commit": "8933abc09df6c381d47dc271b1ee5d266541448e" }, "bufdelete.nvim": { "branch": "master", "commit": "8933abc09df6c381d47dc271b1ee5d266541448e" },
"bufferline.nvim": { "branch": "main", "commit": "b337fd393cef2e3679689d220e2628722c20ddcb" }, "bufferline.nvim": { "branch": "main", "commit": "b337fd393cef2e3679689d220e2628722c20ddcb" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" },
@ -28,6 +29,8 @@
"mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" }, "mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" },
"mini.indentscope": { "branch": "main", "commit": "ff1e68b5c01426f9dfff3278dd1b10c9b5f000a1" }, "mini.indentscope": { "branch": "main", "commit": "ff1e68b5c01426f9dfff3278dd1b10c9b5f000a1" },
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
"noice.nvim": { "branch": "main", "commit": "f148923300b9fc4609d76867f1f95410ab1442e8" },
"nui.nvim": { "branch": "main", "commit": "0dc148c6ec06577fcf06cbab3b7dac96d48ba6be" },
"null-ls.nvim": { "branch": "main", "commit": "689cdd78f70af20a37b5309ebc287ac645ae4f76" }, "null-ls.nvim": { "branch": "main", "commit": "689cdd78f70af20a37b5309ebc287ac645ae4f76" },
"nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" }, "nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" },
"nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" }, "nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" },
@ -57,6 +60,5 @@
"vim-startuptime": { "branch": "master", "commit": "5f52ed26e0296a3e1d1453935f417e5808eefab8" }, "vim-startuptime": { "branch": "master", "commit": "5f52ed26e0296a3e1d1453935f417e5808eefab8" },
"vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" }, "vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" },
"which-key.nvim": { "branch": "main", "commit": "2a0c2d80c0a60f041afb1b789cfedbd510e2b2b6" }, "which-key.nvim": { "branch": "main", "commit": "2a0c2d80c0a60f041afb1b789cfedbd510e2b2b6" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" },
"yanky.nvim": { "branch": "main", "commit": "9fb1c211775b5a6c83b9fe806cfd99f68c65f8a0" } "yanky.nvim": { "branch": "main", "commit": "9fb1c211775b5a6c83b9fe806cfd99f68c65f8a0" }
} }

View file

@ -11,4 +11,5 @@ require("user.keymaps")
-- vim.cmd("colorscheme onedark") -- vim.cmd("colorscheme onedark")
-- vim.cmd("colorscheme dracula") -- vim.cmd("colorscheme dracula")
-- vim.cmd("colorscheme material") -- vim.cmd("colorscheme material")
require("user.snip")
vim.cmd("colorscheme lunar") vim.cmd("colorscheme lunar")

View file

@ -0,0 +1,64 @@
return {
{ "gelguy/wilder.nvim", enabled = false },
{
"folke/noice.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
"nvim-treesitter/nvim-treesitter",
},
event = "BufWinEnter",
config = function()
vim.opt.lazyredraw = false
require("noice").setup()
end,
},
{
"hrsh7th/cmp-cmdline",
event = "BufWinEnter",
config = function()
local cmp = require("cmp")
local mapping = {
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
["<Tab>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
}
-- Use buffer source for `/`.
cmp.setup.cmdline("/", {
preselect = "none",
completion = {
completeopt = "menu,preview,menuone,noselect",
},
mapping = mapping,
sources = {
{ name = "buffer" },
},
experimental = {
ghost_text = true,
native_menu = false,
},
})
-- Use cmdline & path source for ':'.
cmp.setup.cmdline(":", {
preselect = "none",
completion = {
completeopt = "menu,preview,menuone,noselect",
},
mapping = mapping,
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
experimental = {
ghost_text = true,
native_menu = false,
},
})
end,
},
}

View file

@ -8,7 +8,6 @@ return {
"hrsh7th/cmp-path", "hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip", "saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua", "hrsh7th/cmp-nvim-lua",
"hrsh7th/cmp-nvim-lsp-signature-help",
-- { -- {
-- "hrsh7th/cmp-cmdline", -- "hrsh7th/cmp-cmdline",
-- --event = "BufWinEnter", -- --event = "BufWinEnter",
@ -65,7 +64,6 @@ return {
{ name = "buffer" }, { name = "buffer" },
{ name = "path" }, { name = "path" },
{ name = "nvim_lua" }, { name = "nvim_lua" },
{ name = "nvim_lsp_signature_help" },
}), }),
formatting = { formatting = {
fields = { "kind", "abbr", "menu" }, fields = { "kind", "abbr", "menu" },

View file

@ -3,8 +3,7 @@ if not status_ok then
return return
end end
local lpath = vim.fn.stdpath("config") .. "/my-snippets" local lpath = vim.fn.stdpath("config") .. "/snippets"
-- kalau mau di pakai snipetnya baru di buaka remarknya karena bikin berat kalau load terus dan ga di pakai -- kalau mau di pakai snipetnya baru di buaka remarknya karena bikin berat kalau load terus dan ga di pakai

View file

Before

Width:  |  Height:  |  Size: 520 KiB

After

Width:  |  Height:  |  Size: 520 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 9.2 MiB

After

Width:  |  Height:  |  Size: 9.2 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 2.9 MiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 581 KiB

After

Width:  |  Height:  |  Size: 581 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 302 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.2 MiB

After

Width:  |  Height:  |  Size: 2.2 MiB

Before After
Before After

View file

@ -1 +1 @@
custom: ['https://codeigniter.com'] custom: ['https://codeigniter.com']

View file

@ -1,3 +1,3 @@
*.vsix *.vsix
*.NOTE.md *.NOTE.md
*.ex.json *.ex.json

View file

@ -1,17 +1,17 @@
// A launch configuration that launches the extension inside a new window // A launch configuration that launches the extension inside a new window
// Use IntelliSense to learn about possible attributes. // Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes. // Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{ {
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "Extension", "name": "Extension",
"type": "extensionHost", "type": "extensionHost",
"request": "launch", "request": "launch",
"args": [ "args": [
"--extensionDevelopmentPath=${workspaceFolder}" "--extensionDevelopmentPath=${workspaceFolder}"
] ]
} }
] ]
} }

View file

@ -1,7 +1,7 @@
.vscode/** .vscode/**
.vscode-test/** .vscode-test/**
.gitignore .gitignore
vsc-extension-quickstart.md vsc-extension-quickstart.md
docs/** docs/**
*.ex.json *.ex.json
*.NOTE.md *.NOTE.md

View file

@ -1,163 +1,163 @@
# Change Log # Change Log
All notable changes to the "codeigniter4-snippets" extension will be documented in this file. All notable changes to the "codeigniter4-snippets" extension will be documented in this file.
Check [Keep a Changelog](https://github.com/adereksisusanto/codeigniter4-snippets/releases/tag/0.1.1) for recommendations on how to structure this file. Check [Keep a Changelog](https://github.com/adereksisusanto/codeigniter4-snippets/releases/tag/0.1.1) for recommendations on how to structure this file.
## Donate ## Donate
If this project help you reduce time to develop, you can give me a cup of coffee :) If this project help you reduce time to develop, you can give me a cup of coffee :)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/adereksisusanto?locale.x=id_ID) [![Donate](https://img.shields.io/badge/Donate-trakteer.id-red)](https://trakteer.id/adereksisusanto) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/adereksisusanto?locale.x=id_ID) [![Donate](https://img.shields.io/badge/Donate-trakteer.id-red)](https://trakteer.id/adereksisusanto)
## [Released - 0.1.1] - 2021-10-18 ## [Released - 0.1.1] - 2021-10-18
- #### Fixed Bugs Snippets. - #### Fixed Bugs Snippets.
- #### Add New Snippets. - #### Add New Snippets.
- [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md) - [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
- [Request Class](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-request-class) - [Request Class](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-request-class)
- [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md) - [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md)
- [Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#presenter) - [Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#presenter)
- [Resource](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#resource) - [Resource](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#resource)
## [Released - 0.1.0] - 2021-09-21 ## [Released - 0.1.0] - 2021-09-21
- #### Fixed Bugs Snippets. - #### Fixed Bugs Snippets.
- #### Update Snippets. - #### Update Snippets.
- [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md) - [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
- [Controller Resources](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-resources) - [Controller Resources](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-resources)
- #### Add New Snippets. - #### Add New Snippets.
- [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md) - [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
- [Controller Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md##controller-presenter) - [Controller Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md##controller-presenter)
- [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md) - [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md)
- [Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#placeholders) - [Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#placeholders)
- [Custom Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#custom-placeholders) - [Custom Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#custom-placeholders)
## [Released - 0.0.9] - 2021-09-20 ## [Released - 0.0.9] - 2021-09-20
- #### Fixed Bugs Snippets. - #### Fixed Bugs Snippets.
- #### Add New Snippets. - #### Add New Snippets.
- ##### [Validations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md) - ##### [Validations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md)
- ##### [Validation in Controller](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md#validation-in-controller) - ##### [Validation in Controller](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md#validation-in-controller)
## [Released - 0.0.8] - 2021-04-18 ## [Released - 0.0.8] - 2021-04-18
- #### Add New Snippets. - #### Add New Snippets.
- ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md) - ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
## [Released - 0.0.7] - 2021-04-06 ## [Released - 0.0.7] - 2021-04-06
- #### Add New Snippets. - #### Add New Snippets.
- ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md) - ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
## [Released - 0.0.6] - 2021-04-05 ## [Released - 0.0.6] - 2021-04-05
- #### Fixed Bugs Snippets. - #### Fixed Bugs Snippets.
- #### Add New Snippets. - #### Add New Snippets.
- ##### [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md) - ##### [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
- ##### [Models](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MODELS.md) - ##### [Models](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MODELS.md)
## [Released - 0.0.5] ## [Released - 0.0.5]
- #### Fixed Bugs Links. - #### Fixed Bugs Links.
## [Released - 0.0.4] ## [Released - 0.0.4]
- #### Fixed Bugs. - #### Fixed Bugs.
- #### Change Command ( [read](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CHANGE.md) ). - #### Change Command ( [read](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CHANGE.md) ).
- #### Add Docs. - #### Add Docs.
- ##### [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md) - ##### [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md)
- ##### [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VIEWS.md) - ##### [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VIEWS.md)
- #### Add New Snippets {`[ProjectRoot]/app/Views/**.php`} - #### Add New Snippets {`[ProjectRoot]/app/Views/**.php`}
<table> <table>
<thead> <thead>
<tr> <tr>
<th align="center">Command</th> <th align="center">Command</th>
<th align="center">Description</th> <th align="center">Description</th>
<th align="center">Output</th> <th align="center">Output</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap>ci4:views:foreach</td> <td nowrap>ci4:views:foreach</td>
<td>Make <code>foreach</code> in View files</td> <td>Make <code>foreach</code> in View files</td>
<td> <td>
```php ```php
<?php foreach ($items as $item) : ?> <?php foreach ($items as $item) : ?>
<li><?= $item ?></li> <li><?= $item ?></li>
<?php endforeach ?> <?php endforeach ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if</td> <td nowrap>ci4:views:if</td>
<td>Make <code>if</code> in View files</td> <td>Make <code>if</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE --> <!-- TRUE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if-else</td> <td nowrap>ci4:views:if-else</td>
<td>Make <code>if else</code> in View files</td> <td>Make <code>if else</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE --> <!-- TRUE -->
<?php else : ?> <?php else : ?>
<!-- FALSE --> <!-- FALSE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if-elseif</td> <td nowrap>ci4:views:if-elseif</td>
<td>Make <code>if elseif</code> in View files</td> <td>Make <code>if elseif</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE --> <!-- TRUE -->
<?php elseif (condition) : ?> <?php elseif (condition) : ?>
<!-- FALSE --> <!-- FALSE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if-elseif-else</td> <td nowrap>ci4:views:if-elseif-else</td>
<td>Make <code>if elseif else</code> in View files</td> <td>Make <code>if elseif else</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE 1 --> <!-- TRUE 1 -->
<?php elseif (condition) : ?> <?php elseif (condition) : ?>
<!-- TRUE 2 --> <!-- TRUE 2 -->
<?php else : ?> <?php else : ?>
<!-- FALSE --> <!-- FALSE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
## License & Download ## License & Download
[![GitHub license](https://img.shields.io/github/license/adereksisusanto/codeigniter4-snippets.svg)](https://github.com/adereksisusanto/codeigniter4-snippets) ![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/adereksisusanto.codeigniter4-snippets) [![GitHub license](https://img.shields.io/github/license/adereksisusanto/codeigniter4-snippets.svg)](https://github.com/adereksisusanto/codeigniter4-snippets) ![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/adereksisusanto.codeigniter4-snippets)

View file

@ -1,21 +1,21 @@
MIT License MIT License
Copyright (c) 2021 adereksisusanto Copyright (c) 2021 adereksisusanto
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.

View file

@ -1,45 +1,45 @@
# Codeigniter 4 Snippets for Vscode # Codeigniter 4 Snippets for Vscode
This Extensions provides the Codeigniter 4 snippets This Extensions provides the Codeigniter 4 snippets
## Requirements ## Requirements
```bash ```bash
CodeIgniter Version : 4.1.4 CodeIgniter Version : 4.1.4
``` ```
## Install ## Install
Launch Code's command palette Launch Code's command palette
```bash ```bash
ext install adereksisusanto.codeigniter4-snippets ext install adereksisusanto.codeigniter4-snippets
``` ```
### Table of Content ### Table of Content
- [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md) - [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
- [Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md##controller-presenter) - [Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md##controller-presenter)
- [Resources](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-resources) - [Resources](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-resources)
- [Request Class](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-request-class) <sup style="color:red">New</sup> - [Request Class](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md#controller-request-class) <sup style="color:red">New</sup>
- [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md) - [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
- [Models](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MODELS.md) - [Models](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MODELS.md)
- [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md) - [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md)
- [Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#placeholders) - [Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#placeholders)
- [Custom Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#custom-placeholders) - [Custom Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#custom-placeholders)
- [Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#presenter) <sup style="color:red">New</sup> - [Presenter](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#presenter) <sup style="color:red">New</sup>
- [Resource](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#resource) <sup style="color:red">New</sup> - [Resource](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#resource) <sup style="color:red">New</sup>
- [Validation](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md) - [Validation](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md)
- [Validation in Controller](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md#validation-in-controller) - [Validation in Controller](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VALIDATIONS.md#validation-in-controller)
- [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/Views.md) - [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/Views.md)
Happy coding! Happy coding!
## Donate ## Donate
If this project help you reduce time to develop, you can give me a cup of coffee :) If this project help you reduce time to develop, you can give me a cup of coffee :)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/adereksisusanto?locale.x=id_ID) [![Donate](https://img.shields.io/badge/Donate-trakteer.id-red)](https://trakteer.id/adereksisusanto) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/adereksisusanto?locale.x=id_ID) [![Donate](https://img.shields.io/badge/Donate-trakteer.id-red)](https://trakteer.id/adereksisusanto)
## License & Download ## License & Download
[![GitHub license](https://img.shields.io/github/license/adereksisusanto/codeigniter4-snippets.svg)](https://github.com/adereksisusanto/codeigniter4-snippets) ![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/adereksisusanto.codeigniter4-snippets) [![GitHub license](https://img.shields.io/github/license/adereksisusanto/codeigniter4-snippets.svg)](https://github.com/adereksisusanto/codeigniter4-snippets) ![Visual Studio Marketplace Downloads](https://img.shields.io/visual-studio-marketplace/d/adereksisusanto.codeigniter4-snippets)

View file

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Before After
Before After

View file

@ -1,298 +1,298 @@
## Change Command Snippets ## Change Command Snippets
--- ---
### Alternate Snippets for View Files ### Alternate Snippets for View Files
### `[ProjectRoot]/app/Views/**.php` ### `[ProjectRoot]/app/Views/**.php`
<table> <table>
<thead> <thead>
<tr> <tr>
<th align="center" colspan="2">Command</th> <th align="center" colspan="2">Command</th>
<th align="center" rowspan="2">Description</th> <th align="center" rowspan="2">Description</th>
<th align="center" rowspan="2">Output</th> <th align="center" rowspan="2">Output</th>
</tr> </tr>
<tr> <tr>
<th align="center">Lates</th> <th align="center">Lates</th>
<th align="center">News</th> <th align="center">News</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>ci4_endsection</td> <td>ci4_endsection</td>
<td nowrap>ci4:views:endSection</td> <td nowrap>ci4:views:endSection</td>
<td>Make end Section </td> <td>Make end Section </td>
<td> <td>
```php ```php
<?= $this->endSection() ;?> <?= $this->endSection() ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_extend</td> <td>ci4_extend</td>
<td nowrap>ci4:views:extend</td> <td nowrap>ci4:views:extend</td>
<td>Using Layouts in Views</td> <td>Using Layouts in Views</td>
<td> <td>
```php ```php
<?= $this->extend('layouts') ;?> <?= $this->extend('layouts') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_include</td> <td>ci4_include</td>
<td nowrap>ci4:views:include</td> <td nowrap>ci4:views:include</td>
<td>Including View Partials</td> <td>Including View Partials</td>
<td> <td>
```php ```php
<?= $this->include('sidebar') ;?> <?= $this->include('sidebar') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_php</td> <td>ci4_php</td>
<td nowrap>ci4:views:php</td> <td nowrap>ci4:views:php</td>
<td>Make php tag</td> <td>Make php tag</td>
<td> <td>
```php ```php
<?php code ;?> <?php code ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_php_echo</td> <td>ci4_php_echo</td>
<td nowrap>ci4:views:php-echo</td> <td nowrap>ci4:views:php-echo</td>
<td>Make php echo tag</td> <td>Make php echo tag</td>
<td> <td>
```php ```php
<?= code ;?> <?= code ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_rendersection</td> <td>ci4_rendersection</td>
<td nowrap>ci4:views:renderSection</td> <td nowrap>ci4:views:renderSection</td>
<td>Make render Section</td> <td>Make render Section</td>
<td> <td>
```php ```php
<?= $this->renderSection('content') ;?> <?= $this->renderSection('content') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_section</td> <td>ci4_section</td>
<td nowrap>ci4:views:section</td> <td nowrap>ci4:views:section</td>
<td>Make Section</td> <td>Make Section</td>
<td> <td>
```php ```php
<?= $this->section('content') ;?> <?= $this->section('content') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_sectionend</td> <td>ci4_sectionend</td>
<td nowrap>ci4:views:section-endSection</td> <td nowrap>ci4:views:section-endSection</td>
<td>Make Section with end Section</td> <td>Make Section with end Section</td>
<td> <td>
```php ```php
<?= $this->section('content') ;?> <?= $this->section('content') ;?>
<!-- CODE HERE --> <!-- CODE HERE -->
<?= $this->endSection() ;?> <?= $this->endSection() ;?>
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
--- ---
### Alternate Snippets for Routes ### Alternate Snippets for Routes
### `[ProjectRoot]/app/Config/Routes.php` ### `[ProjectRoot]/app/Config/Routes.php`
<table> <table>
<thead> <thead>
<tr> <tr>
<th align="center" colspan="2">Command</th> <th align="center" colspan="2">Command</th>
<th align="center" rowspan="2">Description</th> <th align="center" rowspan="2">Description</th>
<th align="center" rowspan="2">Output</th> <th align="center" rowspan="2">Output</th>
</tr> </tr>
<tr> <tr>
<th align="center">Lates</th> <th align="center">Lates</th>
<th align="center">News</th> <th align="center">News</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>ci4_routes_add</td> <td>ci4_routes_add</td>
<td nowrap>ci4:routes:add</td> <td nowrap>ci4:routes:add</td>
<td>Make Routes add() </td> <td>Make Routes add() </td>
<td> <td>
```php ```php
$routes->add('url', 'ControllerName::index'); $routes->add('url', 'ControllerName::index');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_cli</td> <td>ci4_routes_cli</td>
<td nowrap>ci4:routes:cli</td> <td nowrap>ci4:routes:cli</td>
<td>Make Command-Line only Routes</td> <td>Make Command-Line only Routes</td>
<td> <td>
```php ```php
$routes->cli('migrate', 'App\Database::migrate'); $routes->cli('migrate', 'App\Database::migrate');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_env</td> <td>ci4_routes_env</td>
<td nowrap>ci4:routes:env</td> <td nowrap>ci4:routes:env</td>
<td>Make Routes Environment</td> <td>Make Routes Environment</td>
<td> <td>
```php ```php
$routes->environment('development' , function($routes) $routes->environment('development' , function($routes)
{ {
$routes->add('builder','Tools\Builder::index'); $routes->add('builder','Tools\Builder::index');
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_get</td> <td>ci4_routes_get</td>
<td nowrap>ci4:routes:get</td> <td nowrap>ci4:routes:get</td>
<td>Make Routes get()</td> <td>Make Routes get()</td>
<td> <td>
```php ```php
$routes->get('url', 'ControllerName::index'); $routes->get('url', 'ControllerName::index');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_group</td> <td>ci4_routes_group</td>
<td nowrap>ci4:routes:group</td> <td nowrap>ci4:routes:group</td>
<td>Make Routes group()</td> <td>Make Routes group()</td>
<td> <td>
```php ```php
$routes->group('admin', function($routes) $routes->group('admin', function($routes)
{ {
//Route //Route
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_group_filter</td> <td>ci4_routes_group_filter</td>
<td nowrap>ci4:routes:group-filter</td> <td nowrap>ci4:routes:group-filter</td>
<td>Make Routes group() filter</td> <td>Make Routes group() filter</td>
<td> <td>
```php ```php
$routes->group('api' , ['filter' => 'api-auth'], function($routes) $routes->group('api' , ['filter' => 'api-auth'], function($routes)
{ {
$routes->resource('url'); $routes->resource('url');
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_group_multiple</td> <td>ci4_routes_group_multiple</td>
<td nowrap>ci4:routes:group-multiple</td> <td nowrap>ci4:routes:group-multiple</td>
<td>Make Routes group() multiple</td> <td>Make Routes group() multiple</td>
<td> <td>
```php ```php
$routes->group('admin', function($routes) $routes->group('admin', function($routes)
{ {
$routes->group('users', function($routes) $routes->group('users', function($routes)
{ {
//Route //Route
}); });
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_group_namespace</td> <td>ci4_routes_group_namespace</td>
<td nowrap>ci4:routes:group-namespace</td> <td nowrap>ci4:routes:group-namespace</td>
<td>Make Routes group() namespace</td> <td>Make Routes group() namespace</td>
<td> <td>
```php ```php
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes) $routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
{ {
//Route //Route
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_post</td> <td>ci4_routes_post</td>
<td nowrap>ci4:routes:post</td> <td nowrap>ci4:routes:post</td>
<td>Make Routes post()</td> <td>Make Routes post()</td>
<td> <td>
```php ```php
$routes->post('url', 'ControllerName::index'); $routes->post('url', 'ControllerName::index');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td>ci4_routes_subdomain</td> <td>ci4_routes_subdomain</td>
<td nowrap>ci4:routes:subdomain</td> <td nowrap>ci4:routes:subdomain</td>
<td>Make Routes Limit to Subdomains</td> <td>Make Routes Limit to Subdomains</td>
<td> <td>
```php ```php
$routes->add('from', 'to', ['subdomain' => '*']); $routes->add('from', 'to', ['subdomain' => '*']);
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
</tbody> </tbody>
</table> </table>

View file

@ -1,208 +1,208 @@
### Alternate Snippets for Controllers ### Alternate Snippets for Controllers
### `[ProjectRoot]/app/Controllers/**.php` ### `[ProjectRoot]/app/Controllers/**.php`
### Table of Content ### Table of Content
- [Controllers](#controllers) - [Controllers](#controllers)
- [Presenter](#presenter) - [Presenter](#presenter)
- [Resources](#resources) - [Resources](#resources)
- [Request Class](#request-class) <sup style="color:red">New</sup> - [Request Class](#request-class) <sup style="color:red">New</sup>
#### Controllers #### Controllers
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RENDERS</th> <th align="center">RENDERS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:controller ci4:controller
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
public function index() public function index()
{ {
// code // code
} }
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
##### Presenter ##### Presenter
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RENDERS</th> <th align="center">RENDERS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:controller:presenter ci4:controller:presenter
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
public function __construct() public function __construct()
{ {
// __construct code // __construct code
} }
public function index() public function index()
{ {
// index code // index code
} }
public function show($id = null) public function show($id = null)
{ {
// show code // show code
} }
public function new() public function new()
{ {
// new code // new code
} }
public function create() public function create()
{ {
// create code // create code
} }
public function edit($id = null) public function edit($id = null)
{ {
// edit code // edit code
} }
public function update($id = null) public function update($id = null)
{ {
// update code // update code
} }
public function remove($id = null) public function remove($id = null)
{ {
// remove code // remove code
} }
public function delete($id = null) public function delete($id = null)
{ {
// delete code // delete code
} }
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
##### Resources ##### Resources
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RENDERS</th> <th align="center">RENDERS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:controller:resources ci4:controller:resources
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
public function __construct() public function __construct()
{ {
// __construct code // __construct code
} }
public function index() public function index()
{ {
// index code // index code
} }
public function show($id = null) public function show($id = null)
{ {
// show code // show code
} }
public function new() public function new()
{ {
// new code // new code
} }
public function create() public function create()
{ {
// create code // create code
} }
public function edit($id = null) public function edit($id = null)
{ {
// edit code // edit code
} }
public function update($id = null) public function update($id = null)
{ {
// update code // update code
} }
public function delete($id = null) public function delete($id = null)
{ {
// delete code // delete code
} }
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
##### Request Class ##### Request Class
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RENDERS</th> <th align="center">RENDERS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:controller:request ci4:controller:request
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$this->request->Type('field name'); $this->request->Type('field name');
``` ```
<small> <small>
<strong>Type : </strong>getVar, getGet, getPost, getMethod, isAjax, isCLI, isSecure<br> <strong>Type : </strong>getVar, getGet, getPost, getMethod, isAjax, isCLI, isSecure<br>
</small> </small>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,245 +1,245 @@
# Alternate Snippets for Migrations # Alternate Snippets for Migrations
## `[ProjectRoot]/app/Database/Migrations/` ## `[ProjectRoot]/app/Database/Migrations/`
# Table of Content # Table of Content
- [Create Migration](#create-migration) - [Create Migration](#create-migration)
- [Migration Up](#migration-up) - [Migration Up](#migration-up)
- [Migration Down](#migration-down) - [Migration Down](#migration-down)
- [Create Table](#create-table) - [Create Table](#create-table)
- [Add Column](#add-column) [new] - [Add Column](#add-column) [new]
- [BIGINT](#bigint) [new] - [BIGINT](#bigint) [new]
- [CHAR](#char) [new] - [CHAR](#char) [new]
- [DATETIME](#datetime) [new] - [DATETIME](#datetime) [new]
- [INT](#int) [new] - [INT](#int) [new]
- [VARCHAR](#varchar) [new] - [VARCHAR](#varchar) [new]
- [ID](#id) [new] - [ID](#id) [new]
- [Timestamp](#timestamp) - [Timestamp](#timestamp)
## Create Migration ## Create Migration
**Command** **Command**
```bash ```bash
ci4:migration ci4:migration
``` ```
**Output** **Output**
```php ```php
<?php <?php
namespace App\Database\Migrations; namespace App\Database\Migrations;
use CodeIgniter\Database\Migration; use CodeIgniter\Database\Migration;
class AddBlog extends Migration class AddBlog extends Migration
{ {
public function up() public function up()
{ {
// //
} }
public function down() public function down()
{ {
// //
} }
} }
``` ```
- ### Migration Up - ### Migration Up
**Command** **Command**
```bash ```bash
ci4:migration:up ci4:migration:up
``` ```
**Output** **Output**
```php ```php
public function up() public function up()
{ {
$this->forge->addField([ $this->forge->addField([
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'constraint' => 11, 'constraint' => 11,
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
'name' => [ 'name' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => 255, 'constraint' => 255,
], ],
'created_at' => [ 'created_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
'updated_at' => [ 'updated_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
'deleted_at' => [ 'deleted_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
]); ]);
$this->forge->addKey('id', true); $this->forge->addKey('id', true);
$this->forge->createTable('tableName'); $this->forge->createTable('tableName');
} }
``` ```
- ### Migration Down - ### Migration Down
**Command** **Command**
```bash ```bash
ci4:migration:down ci4:migration:down
``` ```
**Output** **Output**
```php ```php
public function down() public function down()
{ {
$this->forge->dropTable('tableName'); $this->forge->dropTable('tableName');
} }
``` ```
## Create Table ## Create Table
- ### Add Column - ### Add Column
- #### BIGINT - #### BIGINT
**Command** **Command**
```bash ```bash
ci4:migration:bigint ci4:migration:bigint
``` ```
**Output** **Output**
```php ```php
'columnName' => [ 'columnName' => [
'type' => 'BIGINT', 'type' => 'BIGINT',
'constraint' => '20', 'constraint' => '20',
'null' => true, 'null' => true,
], ],
``` ```
- #### CHAR - #### CHAR
**Command** **Command**
```bash ```bash
ci4:migration:char ci4:migration:char
``` ```
**Output** **Output**
```php ```php
'columnName' => [ 'columnName' => [
'type' => 'CHAR', 'type' => 'CHAR',
'constraint' => '10', 'constraint' => '10',
'null' => true, 'null' => true,
], ],
``` ```
- #### DATETIME - #### DATETIME
**Command** **Command**
```bash ```bash
ci4:migration:datetime ci4:migration:datetime
``` ```
**Output** **Output**
```php ```php
'columnName' => [ 'columnName' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
``` ```
- #### INT - #### INT
**Command** **Command**
```bash ```bash
ci4:migration:int ci4:migration:int
``` ```
**Output** **Output**
```php ```php
'columnName' => [ 'columnName' => [
'type' => 'INT', 'type' => 'INT',
'constraint' => '11', 'constraint' => '11',
'null' => true, 'null' => true,
], ],
``` ```
- #### VARCHAR - #### VARCHAR
**Command** **Command**
```bash ```bash
ci4:migration:varchar ci4:migration:varchar
``` ```
**Output** **Output**
```php ```php
'columnName' => [ 'columnName' => [
'type' => 'VARCHAR', 'type' => 'VARCHAR',
'constraint' => '255', 'constraint' => '255',
'null' => true, 'null' => true,
], ],
``` ```
- ### ID - ### ID
**Command :** **Command :**
```bash ```bash
ci4:migration:id ci4:migration:id
``` ```
**Output :** **Output :**
```php ```php
'id' => [ 'id' => [
'type' => 'INT', 'type' => 'INT',
'constraint' => 11, 'constraint' => 11,
'unsigned' => true, 'unsigned' => true,
'auto_increment' => true, 'auto_increment' => true,
], ],
``` ```
- ### Timestamp - ### Timestamp
**Command :** **Command :**
```bash ```bash
ci4:migration:timestamp ci4:migration:timestamp
``` ```
**Output :** **Output :**
```php ```php
'created_at' => [ 'created_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
'updated_at' => [ 'updated_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
'deleted_at' => [ 'deleted_at' => [
'type' => 'DATETIME', 'type' => 'DATETIME',
'null' => true, 'null' => true,
], ],
``` ```

View file

@ -1,36 +1,36 @@
### Alternate Snippets for Models ### Alternate Snippets for Models
### `[ProjectRoot]/app/Models/*.php` ### `[ProjectRoot]/app/Models/*.php`
### Table of Content ### Table of Content
- [Model Config](#model-config) [new] - [Model Config](#model-config) [new]
#### Model Config #### Model Config
- Command - Command
```bash ```bash
ci4:model:config ci4:model:config
``` ```
- Output - Output
```php ```php
protected $table = 'tableName'; protected $table = 'tableName';
protected $primaryKey = 'id'; protected $primaryKey = 'id';
protected $useAutoIncrement = true; protected $useAutoIncrement = true;
protected $returnType = 'array'; protected $returnType = 'array';
protected $useSoftDeletes = true; protected $useSoftDeletes = true;
protected $allowedFields = ['name']; protected $allowedFields = ['name'];
protected $useTimestamps = false; protected $useTimestamps = false;
protected $createdField = 'created_at'; protected $createdField = 'created_at';
protected $updatedField = 'updated_at'; protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at'; protected $deletedField = 'deleted_at';
protected $validationRules = []; protected $validationRules = [];
protected $validationMessages = []; protected $validationMessages = [];
protected $skipValidation = false; protected $skipValidation = false;
``` ```

View file

@ -1,319 +1,319 @@
### Alternate Snippets for Routes ### Alternate Snippets for Routes
### `[ProjectRoot]/app/Config/Routes.php` ### `[ProjectRoot]/app/Config/Routes.php`
### Table of Content ### Table of Content
<!-- - [Alternate Snippets for Routes](#alternate-snippets-for-routes) <!-- - [Alternate Snippets for Routes](#alternate-snippets-for-routes)
- [`[ProjectRoot]/app/Config/Routes.php`](#projectrootappconfigroutesphp) - [`[ProjectRoot]/app/Config/Routes.php`](#projectrootappconfigroutesphp)
- [Table of Content](#table-of-content) --> - [Table of Content](#table-of-content) -->
- [Routes](#routes) - [Routes](#routes)
- [Placeholders](#placeholders) - [Placeholders](#placeholders)
- [Custom Placeholders](#custom-placeholders) - [Custom Placeholders](#custom-placeholders)
- [Presenter](#presenter) - [Presenter](#presenter)
- [Resource](#resource) - [Resource](#resource)
### Routes ### Routes
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RESULTS</th> <th align="center">RESULTS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:add ci4:routes:add
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->add('url', 'ControllerName::index'); $routes->add('url', 'ControllerName::index');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:cli ci4:routes:cli
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->cli('migrate', 'App\Database::migrate'); $routes->cli('migrate', 'App\Database::migrate');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:env ci4:routes:env
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->environment('development' , function($routes) $routes->environment('development' , function($routes)
{ {
$routes->add('builder','Tools\Builder::index'); $routes->add('builder','Tools\Builder::index');
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:get ci4:routes:get
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->get('url', 'ControllerName::index'); $routes->get('url', 'ControllerName::index');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:group ci4:routes:group
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->group('admin', function($routes) $routes->group('admin', function($routes)
{ {
$routes->add('url', 'ControllerName::index'); $routes->add('url', 'ControllerName::index');
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:group-filter ci4:routes:group-filter
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->group('api' , ['filter' => 'api-auth'], function($routes) $routes->group('api' , ['filter' => 'api-auth'], function($routes)
{ {
$routes->resource('url'); $routes->resource('url');
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:group-multiple ci4:routes:group-multiple
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->group('admin', function($routes) $routes->group('admin', function($routes)
{ {
$routes->group('users', function($routes) $routes->group('users', function($routes)
{ {
//Route //Route
}); });
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:group-namespace ci4:routes:group-namespace
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes) $routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
{ {
//Route //Route
}); });
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:post ci4:routes:post
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->post('url', 'ControllerName::index'); $routes->post('url', 'ControllerName::index');
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:subdomain ci4:routes:subdomain
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->add('from', 'to', ['subdomain' => '*']); $routes->add('from', 'to', ['subdomain' => '*']);
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
#### Placeholders #### Placeholders
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RESULTS</th> <th align="center">RESULTS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:placeholder ci4:routes:placeholder
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->type('url/(:placeholder)', 'ControllerName::index/$1'); $routes->type('url/(:placeholder)', 'ControllerName::index/$1');
``` ```
<small> <small>
<strong>Type : </strong>add, get, post, put, delete<br> <strong>Type : </strong>add, get, post, put, delete<br>
<strong>Placeholder : </strong>any, segment, num, alpha, alphanum, hash<br> <strong>Placeholder : </strong>any, segment, num, alpha, alphanum, hash<br>
</small> </small>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
#### Custom Placeholders #### Custom Placeholders
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RESULTS</th> <th align="center">RESULTS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:placeholder:custom ci4:routes:placeholder:custom
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'); $routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
$routes->type('url/(:uuid)', 'ControllerName::index/$1'); $routes->type('url/(:uuid)', 'ControllerName::index/$1');
``` ```
<small> <small>
<strong>Type : </strong>add, get, post, put, delete<br> <strong>Type : </strong>add, get, post, put, delete<br>
</small> </small>
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
</tbody> </tbody>
</table> </table>
#### Presenter #### Presenter
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RESULTS</th> <th align="center">RESULTS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:presenter ci4:routes:presenter
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->presenter('url'); $routes->presenter('url');
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
#### Resource #### Resource
<table style="width:100%"> <table style="width:100%">
<thead> <thead>
<tr> <tr>
<th align="center">COMMANDS</th> <th align="center">COMMANDS</th>
<th align="center">RESULTS</th> <th align="center">RESULTS</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap style="vertical-align: top;"> <td nowrap style="vertical-align: top;">
```code ```code
ci4:routes:resource ci4:routes:resource
``` ```
</td> </td>
<td nowrap> <td nowrap>
```php ```php
$routes->resource('url'); $routes->resource('url');
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,34 +1,34 @@
### Alternate Snippets for Validation ### Alternate Snippets for Validation
### Table of Content ### Table of Content
- [Alternate Snippets for Validation](#alternate-snippets-for-validation) - [Alternate Snippets for Validation](#alternate-snippets-for-validation)
- [Table of Content](#table-of-content) - [Table of Content](#table-of-content)
- [Validation](#validation) - [Validation](#validation)
- [Validation in Controller](#validation-in-controller) - [Validation in Controller](#validation-in-controller)
### Validation ### Validation
#### Validation in Controller #### Validation in Controller
- Command - Command
```code ```code
ci4:validation:controller ci4:validation:controller
``` ```
- Output - Output
```php ```php
$validation = \Config\Services::validation(); $validation = \Config\Services::validation();
$rules = [ $rules = [
'field_1' => [ 'field_1' => [
'label' => 'Field 1 Custom Name', 'label' => 'Field 1 Custom Name',
'rules' => 'required', 'rules' => 'required',
'errors' => [ 'errors' => [
'required' => '{field} is required.' 'required' => '{field} is required.'
] ]
], ],
]; ];
if (!$this->validate($rules)) { if (!$this->validate($rules)) {
return redirect()->to('/route')->withInput()->with('validation', $validation); return redirect()->to('/route')->withInput()->with('validation', $validation);
} }
``` ```

View file

@ -1,190 +1,190 @@
### Alternate Snippets for View Files ### Alternate Snippets for View Files
### `[ProjectRoot]/app/Views/**.php` ### `[ProjectRoot]/app/Views/**.php`
<table> <table>
<thead> <thead>
<tr> <tr>
<th align="center">Command</th> <th align="center">Command</th>
<th align="center">Description</th> <th align="center">Description</th>
<th align="center">Output</th> <th align="center">Output</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td nowrap>ci4:views:endSection</td> <td nowrap>ci4:views:endSection</td>
<td>Make end Section in View files</td> <td>Make end Section in View files</td>
<td> <td>
```php ```php
<?= $this->endSection() ;?> <?= $this->endSection() ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:extend</td> <td nowrap>ci4:views:extend</td>
<td>Using Layouts in Views</td> <td>Using Layouts in Views</td>
<td> <td>
```php ```php
<?= $this->extend('layouts') ;?> <?= $this->extend('layouts') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:foreach</td> <td nowrap>ci4:views:foreach</td>
<td>Make <code>foreach</code> in View files</td> <td>Make <code>foreach</code> in View files</td>
<td> <td>
```php ```php
<?php foreach ($items as $item) : ?> <?php foreach ($items as $item) : ?>
<li><?= $item ?></li> <li><?= $item ?></li>
<?php endforeach ?> <?php endforeach ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if</td> <td nowrap>ci4:views:if</td>
<td>Make <code>if</code> in View files</td> <td>Make <code>if</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE --> <!-- TRUE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if-else</td> <td nowrap>ci4:views:if-else</td>
<td>Make <code>if else</code> in View files</td> <td>Make <code>if else</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE --> <!-- TRUE -->
<?php else : ?> <?php else : ?>
<!-- FALSE --> <!-- FALSE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if-elseif</td> <td nowrap>ci4:views:if-elseif</td>
<td>Make <code>if elseif</code> in View files</td> <td>Make <code>if elseif</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE --> <!-- TRUE -->
<?php elseif (condition) : ?> <?php elseif (condition) : ?>
<!-- FALSE --> <!-- FALSE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:if-elseif-else</td> <td nowrap>ci4:views:if-elseif-else</td>
<td>Make <code>if elseif else</code> in View files</td> <td>Make <code>if elseif else</code> in View files</td>
<td> <td>
```php ```php
<?php if (condition) : ?> <?php if (condition) : ?>
<!-- TRUE 1 --> <!-- TRUE 1 -->
<?php elseif (condition) : ?> <?php elseif (condition) : ?>
<!-- TRUE 2 --> <!-- TRUE 2 -->
<?php else : ?> <?php else : ?>
<!-- FALSE --> <!-- FALSE -->
<?php endif ?> <?php endif ?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:include</td> <td nowrap>ci4:views:include</td>
<td>Including View Partials</td> <td>Including View Partials</td>
<td> <td>
```php ```php
<?= $this->include('sidebar') ;?> <?= $this->include('sidebar') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:php</td> <td nowrap>ci4:views:php</td>
<td>Make php tag in View files</td> <td>Make php tag in View files</td>
<td> <td>
```php ```php
<?php code ;?> <?php code ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:php-echo</td> <td nowrap>ci4:views:php-echo</td>
<td>Make php echo tag in View files</td> <td>Make php echo tag in View files</td>
<td> <td>
```php ```php
<?= code ;?> <?= code ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:renderSection</td> <td nowrap>ci4:views:renderSection</td>
<td>Make render Section in View files</td> <td>Make render Section in View files</td>
<td> <td>
```php ```php
<?= $this->renderSection('content') ;?> <?= $this->renderSection('content') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:section</td> <td nowrap>ci4:views:section</td>
<td>Make Section in View files</td> <td>Make Section in View files</td>
<td> <td>
```php ```php
<?= $this->section('content') ;?> <?= $this->section('content') ;?>
``` ```
</td> </td>
</tr> </tr>
<!-- --> <!-- -->
<tr> <tr>
<td nowrap>ci4:views:section-endSection</td> <td nowrap>ci4:views:section-endSection</td>
<td>Make Section with end Section in View files</td> <td>Make Section with end Section in View files</td>
<td> <td>
```php ```php
<?= $this->section('content') ;?> <?= $this->section('content') ;?>
<!-- CODE HERE --> <!-- CODE HERE -->
<?= $this->endSection() ;?> <?= $this->endSection() ;?>
``` ```
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -1,51 +1,51 @@
{ {
"name": "codeigniter4-snippets", "name": "codeigniter4-snippets",
"displayName": "CodeIgniter4 Snippets", "displayName": "CodeIgniter4 Snippets",
"description": "CodeIgniter4 Snippets for Visual Studio Code", "description": "CodeIgniter4 Snippets for Visual Studio Code",
"icon": "ci4.png", "icon": "ci4.png",
"publisher": "adereksisusanto", "publisher": "adereksisusanto",
"version": "0.1.1", "version": "0.1.1",
"engines": { "engines": {
"vscode": "^1.53.0" "vscode": "^1.53.0"
}, },
"keywords": [ "keywords": [
"codeigniter4", "codeigniter4",
"snippets", "snippets",
"php", "php",
"html" "html"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/adereksisusanto/codeigniter4-snippets" "url": "https://github.com/adereksisusanto/codeigniter4-snippets"
}, },
"categories": [ "categories": [
"Snippets" "Snippets"
], ],
"contributes": { "contributes": {
"snippets": [{ "snippets": [{
"language": "php", "language": "php",
"path": "./snippets/php_controllers.json" "path": "./snippets/php_controllers.json"
}, },
{ {
"language": "php", "language": "php",
"path": "./snippets/php_models.json" "path": "./snippets/php_models.json"
}, },
{ {
"language": "php", "language": "php",
"path": "./snippets/php_migrations.json" "path": "./snippets/php_migrations.json"
}, },
{ {
"language": "php", "language": "php",
"path": "./snippets/php_routes.json" "path": "./snippets/php_routes.json"
}, },
{ {
"language": "php", "language": "php",
"path": "./snippets/php_validations.json" "path": "./snippets/php_validations.json"
}, },
{ {
"language": "html", "language": "html",
"path": "./snippets/html_views.json" "path": "./snippets/html_views.json"
} }
] ]
} }
} }

View file

@ -1,113 +1,113 @@
{ {
"Codeigniter4_VIEWS_ENDSECTION": { "Codeigniter4_VIEWS_ENDSECTION": {
"prefix": "ci4:views:endSection", "prefix": "ci4:views:endSection",
"lang": ["html"], "lang": ["html"],
"body": ["<?= \\$this->endSection() ;?>$0"], "body": ["<?= \\$this->endSection() ;?>$0"],
"description": "CodeIgniter 4 - Make end Section in View files" "description": "CodeIgniter 4 - Make end Section in View files"
}, },
"Codeigniter4_VIEWS_EXTEND": { "Codeigniter4_VIEWS_EXTEND": {
"prefix": "ci4:views:extend", "prefix": "ci4:views:extend",
"lang": ["html"], "lang": ["html"],
"body": ["<?= \\$this->extend('${1:layouts}') ;?>$0"], "body": ["<?= \\$this->extend('${1:layouts}') ;?>$0"],
"description": "CodeIgniter 4 - Using Layouts in Views" "description": "CodeIgniter 4 - Using Layouts in Views"
}, },
"Codeigniter4_VIEWS_FOREACH": { "Codeigniter4_VIEWS_FOREACH": {
"prefix": "ci4:views:foreach", "prefix": "ci4:views:foreach",
"lang": ["html"], "lang": ["html"],
"body": [ "body": [
"<?php foreach (${1:\\$items} as ${2:\\$item}) : ?>", "<?php foreach (${1:\\$items} as ${2:\\$item}) : ?>",
"\t<${3:li}><?= ${4:\\$item}['${5:id}'] ?></${3:li}>", "\t<${3:li}><?= ${4:\\$item}['${5:id}'] ?></${3:li}>",
"<?php endforeach ?>$0" "<?php endforeach ?>$0"
], ],
"description": "CodeIgniter 4 - Make foreach in View files" "description": "CodeIgniter 4 - Make foreach in View files"
}, },
"Codeigniter4_VIEWS_IF": { "Codeigniter4_VIEWS_IF": {
"prefix": "ci4:views:if", "prefix": "ci4:views:if",
"lang": ["html"], "lang": ["html"],
"body": [ "body": [
"<?php if (${1:condition}) : ?>", "<?php if (${1:condition}) : ?>",
"\t${2:<!-- TRUE -->}", "\t${2:<!-- TRUE -->}",
"<?php endif ?>$0" "<?php endif ?>$0"
], ],
"description": "CodeIgniter 4 - Make if in View files" "description": "CodeIgniter 4 - Make if in View files"
}, },
"Codeigniter4_VIEWS_IF_ELSE": { "Codeigniter4_VIEWS_IF_ELSE": {
"prefix": "ci4:views:if-else", "prefix": "ci4:views:if-else",
"lang": ["html"], "lang": ["html"],
"body": [ "body": [
"<?php if (${1:condition}) : ?>", "<?php if (${1:condition}) : ?>",
"\t${2:<!-- TRUE -->}", "\t${2:<!-- TRUE -->}",
"<?php else : ?>", "<?php else : ?>",
"\t${3:<!-- FALSE -->}", "\t${3:<!-- FALSE -->}",
"<?php endif ?>$0" "<?php endif ?>$0"
], ],
"description": "CodeIgniter 4 - Make if else in View files" "description": "CodeIgniter 4 - Make if else in View files"
}, },
"Codeigniter4_VIEWS_IF_ELSEIF": { "Codeigniter4_VIEWS_IF_ELSEIF": {
"prefix": "ci4:views:if-elseif", "prefix": "ci4:views:if-elseif",
"lang": ["html"], "lang": ["html"],
"body": [ "body": [
"<?php if(${1:condition}) : ?>", "<?php if(${1:condition}) : ?>",
"\t${2:<!-- TRUE -->}", "\t${2:<!-- TRUE -->}",
"<?php elseif (${3:condition}) : ?>", "<?php elseif (${3:condition}) : ?>",
"\t${4:<!-- FALSE -->}", "\t${4:<!-- FALSE -->}",
"<?php endif ?>$0" "<?php endif ?>$0"
], ],
"description": "CodeIgniter 4 - Make if elseif in View files" "description": "CodeIgniter 4 - Make if elseif in View files"
}, },
"Codeigniter4_VIEWS_IF_ELSEIF_ELSE": { "Codeigniter4_VIEWS_IF_ELSEIF_ELSE": {
"prefix": "ci4:views:if-elseif-else", "prefix": "ci4:views:if-elseif-else",
"lang": ["html"], "lang": ["html"],
"body": [ "body": [
"<?php if(${1:condition}) : ?>", "<?php if(${1:condition}) : ?>",
"\t${2:<!-- TRUE 1 -->}", "\t${2:<!-- TRUE 1 -->}",
"<?php elseif (${3:condition}) : ?>", "<?php elseif (${3:condition}) : ?>",
"\t${4:<!-- TRUE 2 -->}", "\t${4:<!-- TRUE 2 -->}",
"<?php else : ?>", "<?php else : ?>",
"\t${5:<!-- FALSE -->}", "\t${5:<!-- FALSE -->}",
"<?php endif ?>$0" "<?php endif ?>$0"
], ],
"description": "CodeIgniter 4 - make if elseif else in View files" "description": "CodeIgniter 4 - make if elseif else in View files"
}, },
"Codeigniter4_VIEWS_INCLUDE": { "Codeigniter4_VIEWS_INCLUDE": {
"prefix": "ci4:views:include", "prefix": "ci4:views:include",
"lang": ["html"], "lang": ["html"],
"body": ["<?= \\$this->include('${1:sidebar}') ;?>$0"], "body": ["<?= \\$this->include('${1:sidebar}') ;?>$0"],
"description": "CodeIgniter 4 - Including View Partials" "description": "CodeIgniter 4 - Including View Partials"
}, },
"Codeigniter4_VIEWS_PHP": { "Codeigniter4_VIEWS_PHP": {
"prefix": "ci4:views:php", "prefix": "ci4:views:php",
"lang": ["html"], "lang": ["html"],
"body": ["<?php ${1:code} ;?>$0"], "body": ["<?php ${1:code} ;?>$0"],
"description": "CodeIgniter 4 - Make php tag in View files" "description": "CodeIgniter 4 - Make php tag in View files"
}, },
"Codeigniter4_VIEWS_PHP_ECHO": { "Codeigniter4_VIEWS_PHP_ECHO": {
"prefix": "ci4:views:php-echo", "prefix": "ci4:views:php-echo",
"lang": ["html"], "lang": ["html"],
"body": ["<?= ${1:code} ;?>$0"], "body": ["<?= ${1:code} ;?>$0"],
"description": "CodeIgniter 4 - Make php echo tag in View files" "description": "CodeIgniter 4 - Make php echo tag in View files"
}, },
"Codeigniter4_VIEWS_RENDERSECTION": { "Codeigniter4_VIEWS_RENDERSECTION": {
"prefix": "ci4:views:renderSection", "prefix": "ci4:views:renderSection",
"lang": ["html"], "lang": ["html"],
"body": ["<?= \\$this->renderSection('${1:content}') ;?>$0"], "body": ["<?= \\$this->renderSection('${1:content}') ;?>$0"],
"description": "CodeIgniter 4 - Make render Section in View files" "description": "CodeIgniter 4 - Make render Section in View files"
}, },
"Codeigniter4_VIEWS_SECTION": { "Codeigniter4_VIEWS_SECTION": {
"prefix": "ci4:views:section", "prefix": "ci4:views:section",
"lang": ["html"], "lang": ["html"],
"body": ["<?= \\$this->section('${1:content}') ;?>$0"], "body": ["<?= \\$this->section('${1:content}') ;?>$0"],
"description": "CodeIgniter 4 - Make Section in View files" "description": "CodeIgniter 4 - Make Section in View files"
}, },
"Codeigniter4_VIEWS_SECTION_ENDSECTION": { "Codeigniter4_VIEWS_SECTION_ENDSECTION": {
"prefix": "ci4:views:section-endSection", "prefix": "ci4:views:section-endSection",
"lang": ["html"], "lang": ["html"],
"body": [ "body": [
"<?= \\$this->section('${1:content}') ;?>", "<?= \\$this->section('${1:content}') ;?>",
"${2:<!-- CODE HERE -->}", "${2:<!-- CODE HERE -->}",
"<?= \\$this->endSection() ;?>", "<?= \\$this->endSection() ;?>",
"$0" "$0"
], ],
"description": "CodeIgniter 4 - Make Section with end Section in View files" "description": "CodeIgniter 4 - Make Section with end Section in View files"
} }
} }

View file

@ -1,118 +1,118 @@
{ {
"Codeigniter4_Controller": { "Codeigniter4_Controller": {
"prefix": "ci4:controller", "prefix": "ci4:controller",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"public function ${1:index}(${2:\\$request})", "public function ${1:index}(${2:\\$request})",
"{", "{",
"\t\\\\${3:code}", "\t\\\\${3:code}",
"}$0" "}$0"
], ],
"description": "CodeIgniter 4 - Make Controller" "description": "CodeIgniter 4 - Make Controller"
}, },
"Codeigniter4_Controller_Resources": { "Codeigniter4_Controller_Resources": {
"prefix": "ci4:controller:resources", "prefix": "ci4:controller:resources",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"public function __construct()", "public function __construct()",
"{", "{",
"\t\\\\__construct code", "\t\\\\__construct code",
"}", "}",
"", "",
"public function index()", "public function index()",
"{", "{",
"\t\\\\index code", "\t\\\\index code",
"}", "}",
"", "",
"public function show(\\$id = null)", "public function show(\\$id = null)",
"{", "{",
"\t\\\\show code", "\t\\\\show code",
"}", "}",
"", "",
"public function new()", "public function new()",
"{", "{",
"\t\\\\new code", "\t\\\\new code",
"}", "}",
"", "",
"public function create()", "public function create()",
"{", "{",
"\t\\\\create code", "\t\\\\create code",
"}", "}",
"", "",
"public function edit(\\$id = null)", "public function edit(\\$id = null)",
"{", "{",
"\t\\\\edit code", "\t\\\\edit code",
"}", "}",
"", "",
"public function update(\\$id = null)", "public function update(\\$id = null)",
"{", "{",
"\t\\\\update code", "\t\\\\update code",
"}", "}",
"", "",
"public function delete(\\$id = null)", "public function delete(\\$id = null)",
"{", "{",
"\t\\\\delete code", "\t\\\\delete code",
"}$0" "}$0"
], ],
"description": "CodeIgniter 4 - Make Controller Resources" "description": "CodeIgniter 4 - Make Controller Resources"
}, },
"Codeigniter4_Controller_Presenter": { "Codeigniter4_Controller_Presenter": {
"prefix": "ci4:controller:presenter", "prefix": "ci4:controller:presenter",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"public function __construct()", "public function __construct()",
"{", "{",
"\t\\__construct code", "\t\\__construct code",
"}", "}",
"", "",
"public function index()", "public function index()",
"{", "{",
"\t\\index code", "\t\\index code",
"}", "}",
"", "",
"public function show(\\$id = null)", "public function show(\\$id = null)",
"{", "{",
"\t\\show code", "\t\\show code",
"}", "}",
"", "",
"public function new()", "public function new()",
"{", "{",
"\t\\new code", "\t\\new code",
"}", "}",
"", "",
"public function create()", "public function create()",
"{", "{",
"\t\\create code", "\t\\create code",
"}", "}",
"", "",
"public function edit(\\$id = null)", "public function edit(\\$id = null)",
"{", "{",
"\t\\edit code", "\t\\edit code",
"}", "}",
"", "",
"public function update(\\$id = null)", "public function update(\\$id = null)",
"{", "{",
"\t\\update code", "\t\\update code",
"}", "}",
"", "",
"public function remove(\\$id = null)", "public function remove(\\$id = null)",
"{", "{",
"\t\\remove code", "\t\\remove code",
"}", "}",
"", "",
"public function delete(\\$id = null)", "public function delete(\\$id = null)",
"{", "{",
"\t\\delete code", "\t\\delete code",
"}$0" "}$0"
], ],
"description": "CodeIgniter 4 - Make Controler Presenter" "description": "CodeIgniter 4 - Make Controler Presenter"
}, },
"Codeigniter4_Controller_Request": { "Codeigniter4_Controller_Request": {
"prefix": "ci4:controller:request", "prefix": "ci4:controller:request",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$this->request->${1|getVar,getGet,getPost,getMethod,isAjax,isCLI,isSecure|}('${2:field name}');$0" "\\$this->request->${1|getVar,getGet,getPost,getMethod,isAjax,isCLI,isSecure|}('${2:field name}');$0"
], ],
"description": "CodeIgniter 4 - Make Controller Request Class" "description": "CodeIgniter 4 - Make Controller Request Class"
} }
} }

View file

@ -1,165 +1,165 @@
{ {
"Codeigniter4_Migration": { "Codeigniter4_Migration": {
"prefix": "ci4:migration", "prefix": "ci4:migration",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"<?php", "<?php",
"", "",
"namespace App\\\\Database\\\\Migrations;", "namespace App\\\\Database\\\\Migrations;",
"", "",
"use CodeIgniter\\\\Database\\\\Migration;", "use CodeIgniter\\\\Database\\\\Migration;",
"", "",
"class ${1:AddBlog} extends Migration", "class ${1:AddBlog} extends Migration",
"{", "{",
"\tpublic function up()", "\tpublic function up()",
"\t{", "\t{",
"\t\t$2", "\t\t$2",
"\t}", "\t}",
"", "",
"\tpublic function down()", "\tpublic function down()",
"\t{", "\t{",
"\t\t$3", "\t\t$3",
"\t}", "\t}",
"}$0" "}$0"
], ],
"description": "CodeIgniter 4 - Make Migration" "description": "CodeIgniter 4 - Make Migration"
}, },
"Codeigniter4_Migration_Up": { "Codeigniter4_Migration_Up": {
"prefix": "ci4:migration:up", "prefix": "ci4:migration:up",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"public function up()", "public function up()",
"{", "{",
"\t\\$this->forge->addField([", "\t\\$this->forge->addField([",
"\t\t'${1:id}' => [", "\t\t'${1:id}' => [",
"\t\t\t'type' => 'INT',", "\t\t\t'type' => 'INT',",
"\t\t\t'constraint' => 11,", "\t\t\t'constraint' => 11,",
"\t\t\t'unsigned' => true,", "\t\t\t'unsigned' => true,",
"\t\t\t'auto_increment' => true,", "\t\t\t'auto_increment' => true,",
"\t\t],", "\t\t],",
"\t\t'${2:name}' => [", "\t\t'${2:name}' => [",
"\t\t\t'type' => 'VARCHAR',", "\t\t\t'type' => 'VARCHAR',",
"\t\t\t'constraint' => 255,", "\t\t\t'constraint' => 255,",
"\t\t],", "\t\t],",
"\t\t'created_at' => [", "\t\t'created_at' => [",
"\t\t\t'type' => 'DATETIME',", "\t\t\t'type' => 'DATETIME',",
"\t\t\t'null' => true,", "\t\t\t'null' => true,",
"\t\t],", "\t\t],",
"\t\t'updated_at' => [", "\t\t'updated_at' => [",
"\t\t\t'type' => 'DATETIME',", "\t\t\t'type' => 'DATETIME',",
"\t\t\t'null' => true,", "\t\t\t'null' => true,",
"\t\t],", "\t\t],",
"\t\t'deleted_at' => [", "\t\t'deleted_at' => [",
"\t\t\t'type' => 'DATETIME',", "\t\t\t'type' => 'DATETIME',",
"\t\t\t'null' => true,", "\t\t\t'null' => true,",
"\t\t],", "\t\t],",
"\t]);", "\t]);",
"\t\\$this->forge->addKey('${1:id}', true);", "\t\\$this->forge->addKey('${1:id}', true);",
"\t\\$this->forge->createTable('${3:tableName}');", "\t\\$this->forge->createTable('${3:tableName}');",
"}$0" "}$0"
], ],
"description": "CodeIgniter 4 - Make Migration Up" "description": "CodeIgniter 4 - Make Migration Up"
}, },
"Codeigniter4_Migration_Down": { "Codeigniter4_Migration_Down": {
"prefix": "ci4:migration:down", "prefix": "ci4:migration:down",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"public function down()", "public function down()",
"{", "{",
"\t\\$this->forge->dropTable('${1:tableName}');", "\t\\$this->forge->dropTable('${1:tableName}');",
"}$0" "}$0"
], ],
"description": "CodeIgniter 4 - Make Migration Down" "description": "CodeIgniter 4 - Make Migration Down"
}, },
"Codeigniter4_Migration_BIGINT": { "Codeigniter4_Migration_BIGINT": {
"prefix": "ci4:migration:bigint", "prefix": "ci4:migration:bigint",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'${1:columnName}' => [", "'${1:columnName}' => [",
"\t'type' => 'BIGINT',", "\t'type' => 'BIGINT',",
"\t'constraint' => 20,", "\t'constraint' => 20,",
"\t'null' => true,", "\t'null' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration Type (BIG INTEGER)" "description": "CodeIgniter 4 - Make Migration Type (BIG INTEGER)"
}, },
"Codeigniter4_Migration_CHAR": { "Codeigniter4_Migration_CHAR": {
"prefix": "ci4:migration:char", "prefix": "ci4:migration:char",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'${1:columnName}' => [", "'${1:columnName}' => [",
"\t'type' => 'CHAR',", "\t'type' => 'CHAR',",
"\t'constraint' => 10,", "\t'constraint' => 10,",
"\t'null' => true,", "\t'null' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration Type (CHAR)" "description": "CodeIgniter 4 - Make Migration Type (CHAR)"
}, },
"Codeigniter4_Migration_DATETIME": { "Codeigniter4_Migration_DATETIME": {
"prefix": "ci4:migration:datetime", "prefix": "ci4:migration:datetime",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'${1:columnName}' => [", "'${1:columnName}' => [",
"\t'type' => 'DATETIME',", "\t'type' => 'DATETIME',",
"\t'null' => true,", "\t'null' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration Type (CHAR)" "description": "CodeIgniter 4 - Make Migration Type (CHAR)"
}, },
"Codeigniter4_Migration_INT": { "Codeigniter4_Migration_INT": {
"prefix": "ci4:migration:int", "prefix": "ci4:migration:int",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'${1:columnName}' => [", "'${1:columnName}' => [",
"\t'type' => 'INT',", "\t'type' => 'INT',",
"\t'constraint' => 11,", "\t'constraint' => 11,",
"\t'null' => true,", "\t'null' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration Type (INTEGER)" "description": "CodeIgniter 4 - Make Migration Type (INTEGER)"
}, },
"Codeigniter4_Migration_VARCHAR": { "Codeigniter4_Migration_VARCHAR": {
"prefix": "ci4:migration:varchar", "prefix": "ci4:migration:varchar",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'${1:columnName}' => [", "'${1:columnName}' => [",
"\t'type' => 'VARCHAR',", "\t'type' => 'VARCHAR',",
"\t'constraint' => 255,", "\t'constraint' => 255,",
"\t'null' => true,", "\t'null' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration Type (VARCHAR)" "description": "CodeIgniter 4 - Make Migration Type (VARCHAR)"
}, },
"Codeigniter4_Migration_ID": { "Codeigniter4_Migration_ID": {
"prefix": "ci4:migration:id", "prefix": "ci4:migration:id",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'id' => [", "'id' => [",
"\t'type' => 'INT',", "\t'type' => 'INT',",
"\t'constraint' => 11,", "\t'constraint' => 11,",
"\t'unsigned' => true,", "\t'unsigned' => true,",
"\t'auto_increment' => true,", "\t'auto_increment' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration ID" "description": "CodeIgniter 4 - Make Migration ID"
}, },
"Codeigniter4_Migration_Timestamp": { "Codeigniter4_Migration_Timestamp": {
"prefix": "ci4:migration:timestamp", "prefix": "ci4:migration:timestamp",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"'created_at' => [", "'created_at' => [",
"\t'type' => 'DATETIME',", "\t'type' => 'DATETIME',",
"\t'null' => true,", "\t'null' => true,",
"],", "],",
"'updated_at' => [", "'updated_at' => [",
"\t'type' => 'DATETIME',", "\t'type' => 'DATETIME',",
"\t'null' => true,", "\t'null' => true,",
"],", "],",
"'deleted_at' => [", "'deleted_at' => [",
"\t'type' => 'DATETIME',", "\t'type' => 'DATETIME',",
"\t'null' => true,", "\t'null' => true,",
"],$0" "],$0"
], ],
"description": "CodeIgniter 4 - Make Migration Timestamp" "description": "CodeIgniter 4 - Make Migration Timestamp"
} }
} }

View file

@ -1,28 +1,28 @@
{ {
"Codeigniter4_Model_Config": { "Codeigniter4_Model_Config": {
"prefix": "ci4:model:config", "prefix": "ci4:model:config",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"protected \\$table = '${1:tableName}';", "protected \\$table = '${1:tableName}';",
"protected \\$primaryKey = '${2:id}';", "protected \\$primaryKey = '${2:id}';",
"", "",
"protected \\$useAutoIncrement = ${3:true};", "protected \\$useAutoIncrement = ${3:true};",
"", "",
"protected \\$returnType = '${4:array}';", "protected \\$returnType = '${4:array}';",
"protected \\$useSoftDeletes = ${5:false};", "protected \\$useSoftDeletes = ${5:false};",
"", "",
"protected \\$allowedFields = ['${6:name}'];", "protected \\$allowedFields = ['${6:name}'];",
"", "",
"protected \\$useTimestamps = ${7:true};", "protected \\$useTimestamps = ${7:true};",
"protected \\$createdField = '${8:created_at}';", "protected \\$createdField = '${8:created_at}';",
"protected \\$updatedField = '${9:updated_at}';", "protected \\$updatedField = '${9:updated_at}';",
"protected \\$useTimestamps = '${10:deleted_at}';", "protected \\$useTimestamps = '${10:deleted_at}';",
"", "",
"protected \\$validationRules = ${11:[]};", "protected \\$validationRules = ${11:[]};",
"protected \\$validationMessages = ${12:[]};", "protected \\$validationMessages = ${12:[]};",
"protected \\$skipValidation = ${13:false};", "protected \\$skipValidation = ${13:false};",
"$0" "$0"
], ],
"description": "CodeIgniter 4 - Make Model Configuring" "description": "CodeIgniter 4 - Make Model Configuring"
} }
} }

View file

@ -1,129 +1,129 @@
{ {
"Codeigniter4_ROUTES_ADD": { "Codeigniter4_ROUTES_ADD": {
"prefix": "ci4:routes:add", "prefix": "ci4:routes:add",
"lang": ["php"], "lang": ["php"],
"body": ["\\$routes->add('${1:url}','${2:ControllerName}::${3:index}');$0"], "body": ["\\$routes->add('${1:url}','${2:ControllerName}::${3:index}');$0"],
"description": "CodeIgniter 4 - Make Routes add()" "description": "CodeIgniter 4 - Make Routes add()"
}, },
"Codeigniter4_ROUTES_CLI": { "Codeigniter4_ROUTES_CLI": {
"prefix": "ci4:routes:cli", "prefix": "ci4:routes:cli",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->cli('${1:migrate}','${2:App\\\\Database}::${3:migrate}');$0" "\\$routes->cli('${1:migrate}','${2:App\\\\Database}::${3:migrate}');$0"
], ],
"description": "CodeIgniter 4 - Make Command-Line only Routes" "description": "CodeIgniter 4 - Make Command-Line only Routes"
}, },
"Codeigniter4_ROUTES_ENVIRONMENT": { "Codeigniter4_ROUTES_ENVIRONMENT": {
"prefix": "ci4:routes:env", "prefix": "ci4:routes:env",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->environment('${1:development}', function(\\$routes)", "\\$routes->environment('${1:development}', function(\\$routes)",
"{", "{",
"\t\\$routes->add('${2:builder}','${3:Tools\\\\Builder}::${4:index}');", "\t\\$routes->add('${2:builder}','${3:Tools\\\\Builder}::${4:index}');",
"});$0" "});$0"
], ],
"description": "CodeIgniter 4 - Make Routes Environment" "description": "CodeIgniter 4 - Make Routes Environment"
}, },
"Codeigniter4_ROUTES_GET": { "Codeigniter4_ROUTES_GET": {
"prefix": "ci4:routes:get", "prefix": "ci4:routes:get",
"lang": ["php"], "lang": ["php"],
"body": ["\\$routes->get('${1:url}','${2:ControllerName}::${3:index}');$0"], "body": ["\\$routes->get('${1:url}','${2:ControllerName}::${3:index}');$0"],
"description": "CodeIgniter 4 - Make Routes get()" "description": "CodeIgniter 4 - Make Routes get()"
}, },
"Codeigniter4_ROUTES_GROUP": { "Codeigniter4_ROUTES_GROUP": {
"prefix": "ci4:routes:group", "prefix": "ci4:routes:group",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->group('${1:admin}', function(\\$routes)", "\\$routes->group('${1:admin}', function(\\$routes)",
"{", "{",
"\t\\$routes->add('${2:url}','${3:ControllerName}::${4:index};')", "\t\\$routes->add('${2:url}','${3:ControllerName}::${4:index};')",
"});$0" "});$0"
], ],
"description": "CodeIgniter 4 - Make Routes group()" "description": "CodeIgniter 4 - Make Routes group()"
}, },
"Codeigniter4_ROUTES_GROUP_FILTER": { "Codeigniter4_ROUTES_GROUP_FILTER": {
"prefix": "ci4:routes:group-filter", "prefix": "ci4:routes:group-filter",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->group('${1:api}',['filter' => '${2:api-auth}'], function(\\$routes)", "\\$routes->group('${1:api}',['filter' => '${2:api-auth}'], function(\\$routes)",
"{", "{",
"\t\\$routes->resource('${3:url}');", "\t\\$routes->resource('${3:url}');",
"});$0" "});$0"
], ],
"description": "CodeIgniter 4 - Make Routes group() filter" "description": "CodeIgniter 4 - Make Routes group() filter"
}, },
"Codeigniter4_ROUTES_GROUP_MULTIPLE": { "Codeigniter4_ROUTES_GROUP_MULTIPLE": {
"prefix": "ci4:routes:group-multiple", "prefix": "ci4:routes:group-multiple",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->group('${1:admin}', function(\\$routes)", "\\$routes->group('${1:admin}', function(\\$routes)",
"{", "{",
"\t\\$routes->group('${2:users}', function(\\$routes)", "\t\\$routes->group('${2:users}', function(\\$routes)",
"\t{", "\t{",
"\t\t\\${3:// Route}", "\t\t\\${3:// Route}",
"\t});", "\t});",
"});$0" "});$0"
], ],
"description": "CodeIgniter 4 - Make Routes group() multiple" "description": "CodeIgniter 4 - Make Routes group() multiple"
}, },
"Codeigniter4_ROUTES_GROUP_NAMESPACE": { "Codeigniter4_ROUTES_GROUP_NAMESPACE": {
"prefix": "ci4:routes:group-namespace", "prefix": "ci4:routes:group-namespace",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->group('${1:api}',['namespace' => '${2:App\\\\API\\\\v1}'], function(\\$routes)", "\\$routes->group('${1:api}',['namespace' => '${2:App\\\\API\\\\v1}'], function(\\$routes)",
"{", "{",
"\t\\${3://Route}", "\t\\${3://Route}",
"});$0" "});$0"
], ],
"description": "CodeIgniter 4 - Make Routes group() namespace" "description": "CodeIgniter 4 - Make Routes group() namespace"
}, },
"Codeigniter4_ROUTES_PLACEHOLDER": { "Codeigniter4_ROUTES_PLACEHOLDER": {
"prefix": "ci4:routes:placeholder", "prefix": "ci4:routes:placeholder",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->${1|add,get,post,put,delete|}('${2:url}/(:${3|any,segment,num,alpha,alphanum,hash|})','${4:ControllerName}::${5:index}/\\$1');$0" "\\$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)" "description": "CodeIgniter 4 - Make Routes Placeholder (:any) (:segment) (:num) (:alpha) (:alphanum) (:hash)"
}, },
"Codeigniter4_ROUTES_PLACEHOLDER_CUSTOM": { "Codeigniter4_ROUTES_PLACEHOLDER_CUSTOM": {
"prefix": "ci4:routes:placeholder:custom", "prefix": "ci4:routes:placeholder:custom",
"lang": ["php"], "lang": ["php"],
"body": [ "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->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" "\\$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)" "description": "CodeIgniter 4 - Make Routes Custom Placeholder default (:uuid)"
}, },
"Codeigniter4_ROUTES_POST": { "Codeigniter4_ROUTES_POST": {
"prefix": "ci4:routes:post", "prefix": "ci4:routes:post",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->post('${1:url}','${2:ControllerName}::${3:index}');$0" "\\$routes->post('${1:url}','${2:ControllerName}::${3:index}');$0"
], ],
"description": "CodeIgniter 4 - Make Routes post()" "description": "CodeIgniter 4 - Make Routes post()"
}, },
"Codeigniter4_ROUTES_PRESENTER": { "Codeigniter4_ROUTES_PRESENTER": {
"prefix": "ci4:routes:presenter", "prefix": "ci4:routes:presenter",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->presenter('${1:url}');$0" "\\$routes->presenter('${1:url}');$0"
], ],
"description": "CodeIgniter 4 - Make Routes presenter()" "description": "CodeIgniter 4 - Make Routes presenter()"
}, },
"Codeigniter4_ROUTES_RESOURCE": { "Codeigniter4_ROUTES_RESOURCE": {
"prefix": "ci4:routes:resource", "prefix": "ci4:routes:resource",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->resource('${1:url}');$0" "\\$routes->resource('${1:url}');$0"
], ],
"description": "CodeIgniter 4 - Make Routes resource()" "description": "CodeIgniter 4 - Make Routes resource()"
}, },
"Codeigniter4_ROUTES_SUBDOMAIN": { "Codeigniter4_ROUTES_SUBDOMAIN": {
"prefix": "ci4:routes:subdomain", "prefix": "ci4:routes:subdomain",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$routes->add('${1:from}', '${2:to}', ['subdomain' => '${2:*}']);$0" "\\$routes->add('${1:from}', '${2:to}', ['subdomain' => '${2:*}']);$0"
], ],
"description": "CodeIgniter 4 - Make Routes Limit to Subdomains" "description": "CodeIgniter 4 - Make Routes Limit to Subdomains"
} }
} }

View file

@ -1,23 +1,23 @@
{ {
"Codeigniter4_Validation_Controller": { "Codeigniter4_Validation_Controller": {
"prefix": "ci4:validation:controller", "prefix": "ci4:validation:controller",
"lang": ["php"], "lang": ["php"],
"body": [ "body": [
"\\$validation = \\\\Config\\\\Services::validation();", "\\$validation = \\\\Config\\\\Services::validation();",
"\\$rules = [", "\\$rules = [",
"\t 'field_1' => [", "\t 'field_1' => [",
"\t\t'label'\t=> 'Field 1 Custom Name',", "\t\t'label'\t=> 'Field 1 Custom Name',",
"\t\t'rules'\t=> 'required',", "\t\t'rules'\t=> 'required',",
"\t\t'errors'\t=> [", "\t\t'errors'\t=> [",
"\t\t\t'required'\t=> '{field} is required.'", "\t\t\t'required'\t=> '{field} is required.'",
"\t\t]", "\t\t]",
"\t],", "\t],",
"];", "];",
"if (!\\$this->validate(\\$rules)) {", "if (!\\$this->validate(\\$rules)) {",
"\treturn redirect()->to('${1:route}')->withInput()->with('validation', \\$validation);", "\treturn redirect()->to('${1:route}')->withInput()->with('validation', \\$validation);",
"}", "}",
"$0" "$0"
], ],
"description": "CodeIgniter 4 - Make Validation in Controller" "description": "CodeIgniter 4 - Make Validation in Controller"
} }
} }

View file

@ -1,80 +1,80 @@
{ {
"name": "font-awesome-5-codes-html", "name": "font-awesome-5-codes-html",
"displayName": "Font awesome 5 HTML snippets", "displayName": "Font awesome 5 HTML snippets",
"description": "Font awesome 5 HTML snippets", "description": "Font awesome 5 HTML snippets",
"icon": "fontawesome_128px.png", "icon": "fontawesome_128px.png",
"version": "1.0.1", "version": "1.0.1",
"publisher": "mrdemonwolf", "publisher": "mrdemonwolf",
"license": "See License section in README.md", "license": "See License section in README.md",
"homepage": "https://github.com/MrDemonWolf/font-awesome-5-codes-html/blob/master/README.md", "homepage": "https://github.com/MrDemonWolf/font-awesome-5-codes-html/blob/master/README.md",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/MrDemonWolf/font-awesome-5-codes-html.git" "url": "https://github.com/MrDemonWolf/font-awesome-5-codes-html.git"
}, },
"engines": { "engines": {
"vscode": "^0.10.1" "vscode": "^0.10.1"
}, },
"galleryBanner": { "galleryBanner": {
"color": "#E6E0EA", "color": "#E6E0EA",
"theme": "light" "theme": "light"
}, },
"categories": [ "categories": [
"Snippets" "Snippets"
], ],
"contributes": { "contributes": {
"snippets": [ "snippets": [
{ {
"language": "blade", "language": "blade",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "ejs", "language": "ejs",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "html", "language": "html",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "handlebars", "language": "handlebars",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "latte", "language": "latte",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "php", "language": "php",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "plaintext", "language": "plaintext",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "razor", "language": "razor",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "tpl", "language": "tpl",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "typescript", "language": "typescript",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "typescriptreact", "language": "typescriptreact",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "twig", "language": "twig",
"path": "./snippets.json" "path": "./snippets.json"
}, },
{ {
"language": "vue", "language": "vue",
"path": "./snippets.json" "path": "./snippets.json"
} }
] ]
} }
} }

Some files were not shown because too many files have changed in this diff Show more