update cmd line
|
@ -5,6 +5,7 @@
|
|||
"bufdelete.nvim": { "branch": "master", "commit": "8933abc09df6c381d47dc271b1ee5d266541448e" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "b337fd393cef2e3679689d220e2628722c20ddcb" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" },
|
||||
|
@ -28,6 +29,8 @@
|
|||
"mini.animate": { "branch": "main", "commit": "b0c717ed5513b5f23e7c48615449c7dc9fabd05b" },
|
||||
"mini.indentscope": { "branch": "main", "commit": "ff1e68b5c01426f9dfff3278dd1b10c9b5f000a1" },
|
||||
"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" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" },
|
||||
|
@ -57,6 +60,5 @@
|
|||
"vim-startuptime": { "branch": "master", "commit": "5f52ed26e0296a3e1d1453935f417e5808eefab8" },
|
||||
"vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "2a0c2d80c0a60f041afb1b789cfedbd510e2b2b6" },
|
||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" },
|
||||
"yanky.nvim": { "branch": "main", "commit": "9fb1c211775b5a6c83b9fe806cfd99f68c65f8a0" }
|
||||
}
|
|
@ -11,4 +11,5 @@ require("user.keymaps")
|
|||
-- vim.cmd("colorscheme onedark")
|
||||
-- vim.cmd("colorscheme dracula")
|
||||
-- vim.cmd("colorscheme material")
|
||||
require("user.snip")
|
||||
vim.cmd("colorscheme lunar")
|
||||
|
|
64
lua/custom/plugins/cmdline.lua
Normal 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,
|
||||
},
|
||||
}
|
|
@ -8,7 +8,6 @@ return {
|
|||
"hrsh7th/cmp-path",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||
-- {
|
||||
-- "hrsh7th/cmp-cmdline",
|
||||
-- --event = "BufWinEnter",
|
||||
|
@ -65,7 +64,6 @@ return {
|
|||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
}),
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
|
|
|
@ -3,8 +3,7 @@ if not status_ok then
|
|||
return
|
||||
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
|
||||
|
||||
|
|
Before Width: | Height: | Size: 520 KiB After Width: | Height: | Size: 520 KiB |
Before Width: | Height: | Size: 9.2 MiB After Width: | Height: | Size: 9.2 MiB |
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 581 KiB After Width: | Height: | Size: 581 KiB |
Before Width: | Height: | Size: 302 KiB After Width: | Height: | Size: 302 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
|
@ -1 +1 @@
|
|||
custom: ['https://codeigniter.com']
|
||||
custom: ['https://codeigniter.com']
|
|
@ -1,3 +1,3 @@
|
|||
*.vsix
|
||||
*.NOTE.md
|
||||
*.vsix
|
||||
*.NOTE.md
|
||||
*.ex.json
|
|
@ -1,17 +1,17 @@
|
|||
// A launch configuration that launches the extension inside a new window
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
]
|
||||
}
|
||||
]
|
||||
// A launch configuration that launches the extension inside a new window
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
.vscode/**
|
||||
.vscode-test/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
||||
docs/**
|
||||
*.ex.json
|
||||
*.NOTE.md
|
||||
.vscode/**
|
||||
.vscode-test/**
|
||||
.gitignore
|
||||
vsc-extension-quickstart.md
|
||||
docs/**
|
||||
*.ex.json
|
||||
*.NOTE.md
|
|
@ -1,163 +1,163 @@
|
|||
# Change Log
|
||||
|
||||
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.
|
||||
|
||||
## Donate
|
||||
If this project help you reduce time to develop, you can give me a cup of coffee :)
|
||||
|
||||
[](https://paypal.me/adereksisusanto?locale.x=id_ID) [](https://trakteer.id/adereksisusanto)
|
||||
|
||||
## [Released - 0.1.1] - 2021-10-18
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Add New Snippets.
|
||||
- [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)
|
||||
- [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)
|
||||
- [Resource](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#resource)
|
||||
|
||||
## [Released - 0.1.0] - 2021-09-21
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Update Snippets.
|
||||
- [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)
|
||||
- #### Add New Snippets.
|
||||
- [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)
|
||||
- [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)
|
||||
- [Custom Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#custom-placeholders)
|
||||
|
||||
## [Released - 0.0.9] - 2021-09-20
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Add New Snippets.
|
||||
- ##### [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)
|
||||
|
||||
## [Released - 0.0.8] - 2021-04-18
|
||||
|
||||
- #### Add New Snippets.
|
||||
- ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
|
||||
|
||||
## [Released - 0.0.7] - 2021-04-06
|
||||
|
||||
- #### Add New Snippets.
|
||||
- ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
|
||||
|
||||
## [Released - 0.0.6] - 2021-04-05
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Add New Snippets.
|
||||
- ##### [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
|
||||
- ##### [Models](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MODELS.md)
|
||||
|
||||
## [Released - 0.0.5]
|
||||
|
||||
- #### Fixed Bugs Links.
|
||||
|
||||
## [Released - 0.0.4]
|
||||
|
||||
- #### Fixed Bugs.
|
||||
- #### Change Command ( [read](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CHANGE.md) ).
|
||||
- #### Add Docs.
|
||||
- ##### [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md)
|
||||
- ##### [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VIEWS.md)
|
||||
- #### Add New Snippets {`[ProjectRoot]/app/Views/**.php`}
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Command</th>
|
||||
<th align="center">Description</th>
|
||||
<th align="center">Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap>ci4:views:foreach</td>
|
||||
<td>Make <code>foreach</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php foreach ($items as $item) : ?>
|
||||
<li><?= $item ?></li>
|
||||
<?php endforeach ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if</td>
|
||||
<td>Make <code>if</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-else</td>
|
||||
<td>Make <code>if else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif</td>
|
||||
<td>Make <code>if elseif</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif-else</td>
|
||||
<td>Make <code>if elseif else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE 1 -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- TRUE 2 -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## License & Download
|
||||
|
||||
[](https://github.com/adereksisusanto/codeigniter4-snippets) 
|
||||
# Change Log
|
||||
|
||||
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.
|
||||
|
||||
## Donate
|
||||
If this project help you reduce time to develop, you can give me a cup of coffee :)
|
||||
|
||||
[](https://paypal.me/adereksisusanto?locale.x=id_ID) [](https://trakteer.id/adereksisusanto)
|
||||
|
||||
## [Released - 0.1.1] - 2021-10-18
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Add New Snippets.
|
||||
- [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)
|
||||
- [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)
|
||||
- [Resource](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#resource)
|
||||
|
||||
## [Released - 0.1.0] - 2021-09-21
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Update Snippets.
|
||||
- [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)
|
||||
- #### Add New Snippets.
|
||||
- [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)
|
||||
- [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)
|
||||
- [Custom Placeholders](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md#custom-placeholders)
|
||||
|
||||
## [Released - 0.0.9] - 2021-09-20
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Add New Snippets.
|
||||
- ##### [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)
|
||||
|
||||
## [Released - 0.0.8] - 2021-04-18
|
||||
|
||||
- #### Add New Snippets.
|
||||
- ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
|
||||
|
||||
## [Released - 0.0.7] - 2021-04-06
|
||||
|
||||
- #### Add New Snippets.
|
||||
- ##### [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.md)
|
||||
|
||||
## [Released - 0.0.6] - 2021-04-05
|
||||
|
||||
- #### Fixed Bugs Snippets.
|
||||
- #### Add New Snippets.
|
||||
- ##### [Controllers](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CONTROLLERS.md)
|
||||
- ##### [Models](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MODELS.md)
|
||||
|
||||
## [Released - 0.0.5]
|
||||
|
||||
- #### Fixed Bugs Links.
|
||||
|
||||
## [Released - 0.0.4]
|
||||
|
||||
- #### Fixed Bugs.
|
||||
- #### Change Command ( [read](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/CHANGE.md) ).
|
||||
- #### Add Docs.
|
||||
- ##### [Routes](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/ROUTES.md)
|
||||
- ##### [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/VIEWS.md)
|
||||
- #### Add New Snippets {`[ProjectRoot]/app/Views/**.php`}
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Command</th>
|
||||
<th align="center">Description</th>
|
||||
<th align="center">Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap>ci4:views:foreach</td>
|
||||
<td>Make <code>foreach</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php foreach ($items as $item) : ?>
|
||||
<li><?= $item ?></li>
|
||||
<?php endforeach ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if</td>
|
||||
<td>Make <code>if</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-else</td>
|
||||
<td>Make <code>if else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif</td>
|
||||
<td>Make <code>if elseif</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif-else</td>
|
||||
<td>Make <code>if elseif else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE 1 -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- TRUE 2 -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
## License & Download
|
||||
|
||||
[](https://github.com/adereksisusanto/codeigniter4-snippets) 
|
|
@ -1,21 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2021 adereksisusanto
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
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
|
||||
SOFTWARE.
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 adereksisusanto
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
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
|
||||
SOFTWARE.
|
|
@ -1,45 +1,45 @@
|
|||
# Codeigniter 4 Snippets for Vscode
|
||||
|
||||
This Extensions provides the Codeigniter 4 snippets
|
||||
|
||||
## Requirements
|
||||
|
||||
```bash
|
||||
CodeIgniter Version : 4.1.4
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
Launch Code's command palette
|
||||
|
||||
```bash
|
||||
ext install adereksisusanto.codeigniter4-snippets
|
||||
```
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [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)
|
||||
- [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>
|
||||
- [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.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)
|
||||
- [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)
|
||||
- [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>
|
||||
- [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)
|
||||
- [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/Views.md)
|
||||
|
||||
Happy coding!
|
||||
|
||||
## Donate
|
||||
If this project help you reduce time to develop, you can give me a cup of coffee :)
|
||||
|
||||
[](https://paypal.me/adereksisusanto?locale.x=id_ID) [](https://trakteer.id/adereksisusanto)
|
||||
|
||||
## License & Download
|
||||
|
||||
[](https://github.com/adereksisusanto/codeigniter4-snippets) 
|
||||
# Codeigniter 4 Snippets for Vscode
|
||||
|
||||
This Extensions provides the Codeigniter 4 snippets
|
||||
|
||||
## Requirements
|
||||
|
||||
```bash
|
||||
CodeIgniter Version : 4.1.4
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
Launch Code's command palette
|
||||
|
||||
```bash
|
||||
ext install adereksisusanto.codeigniter4-snippets
|
||||
```
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [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)
|
||||
- [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>
|
||||
- [Migrations](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/MIGRATIONS.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)
|
||||
- [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)
|
||||
- [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>
|
||||
- [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)
|
||||
- [Views](https://github.com/adereksisusanto/codeigniter4-snippets/blob/main/docs/Views.md)
|
||||
|
||||
Happy coding!
|
||||
|
||||
## Donate
|
||||
If this project help you reduce time to develop, you can give me a cup of coffee :)
|
||||
|
||||
[](https://paypal.me/adereksisusanto?locale.x=id_ID) [](https://trakteer.id/adereksisusanto)
|
||||
|
||||
## License & Download
|
||||
|
||||
[](https://github.com/adereksisusanto/codeigniter4-snippets) 
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
@ -1,298 +1,298 @@
|
|||
## Change Command Snippets
|
||||
|
||||
---
|
||||
|
||||
### Alternate Snippets for View Files
|
||||
|
||||
### `[ProjectRoot]/app/Views/**.php`
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" colspan="2">Command</th>
|
||||
<th align="center" rowspan="2">Description</th>
|
||||
<th align="center" rowspan="2">Output</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="center">Lates</th>
|
||||
<th align="center">News</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>ci4_endsection</td>
|
||||
<td nowrap>ci4:views:endSection</td>
|
||||
<td>Make end Section </td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_extend</td>
|
||||
<td nowrap>ci4:views:extend</td>
|
||||
<td>Using Layouts in Views</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->extend('layouts') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_include</td>
|
||||
<td nowrap>ci4:views:include</td>
|
||||
<td>Including View Partials</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->include('sidebar') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_php</td>
|
||||
<td nowrap>ci4:views:php</td>
|
||||
<td>Make php tag</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_php_echo</td>
|
||||
<td nowrap>ci4:views:php-echo</td>
|
||||
<td>Make php echo tag</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_rendersection</td>
|
||||
<td nowrap>ci4:views:renderSection</td>
|
||||
<td>Make render Section</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->renderSection('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_section</td>
|
||||
<td nowrap>ci4:views:section</td>
|
||||
<td>Make Section</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_sectionend</td>
|
||||
<td nowrap>ci4:views:section-endSection</td>
|
||||
<td>Make Section with end Section</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
<!-- CODE HERE -->
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
### Alternate Snippets for Routes
|
||||
|
||||
### `[ProjectRoot]/app/Config/Routes.php`
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" colspan="2">Command</th>
|
||||
<th align="center" rowspan="2">Description</th>
|
||||
<th align="center" rowspan="2">Output</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="center">Lates</th>
|
||||
<th align="center">News</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>ci4_routes_add</td>
|
||||
<td nowrap>ci4:routes:add</td>
|
||||
<td>Make Routes add() </td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->add('url', 'ControllerName::index');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_cli</td>
|
||||
<td nowrap>ci4:routes:cli</td>
|
||||
<td>Make Command-Line only Routes</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->cli('migrate', 'App\Database::migrate');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_env</td>
|
||||
<td nowrap>ci4:routes:env</td>
|
||||
<td>Make Routes Environment</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->environment('development' , function($routes)
|
||||
{
|
||||
$routes->add('builder','Tools\Builder::index');
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_get</td>
|
||||
<td nowrap>ci4:routes:get</td>
|
||||
<td>Make Routes get()</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->get('url', 'ControllerName::index');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group</td>
|
||||
<td nowrap>ci4:routes:group</td>
|
||||
<td>Make Routes group()</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group_filter</td>
|
||||
<td nowrap>ci4:routes:group-filter</td>
|
||||
<td>Make Routes group() filter</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['filter' => 'api-auth'], function($routes)
|
||||
{
|
||||
$routes->resource('url');
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group_multiple</td>
|
||||
<td nowrap>ci4:routes:group-multiple</td>
|
||||
<td>Make Routes group() multiple</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
$routes->group('users', function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group_namespace</td>
|
||||
<td nowrap>ci4:routes:group-namespace</td>
|
||||
<td>Make Routes group() namespace</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_post</td>
|
||||
<td nowrap>ci4:routes:post</td>
|
||||
<td>Make Routes post()</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->post('url', 'ControllerName::index');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_subdomain</td>
|
||||
<td nowrap>ci4:routes:subdomain</td>
|
||||
<td>Make Routes Limit to Subdomains</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->add('from', 'to', ['subdomain' => '*']);
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
</tbody>
|
||||
</table>
|
||||
## Change Command Snippets
|
||||
|
||||
---
|
||||
|
||||
### Alternate Snippets for View Files
|
||||
|
||||
### `[ProjectRoot]/app/Views/**.php`
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" colspan="2">Command</th>
|
||||
<th align="center" rowspan="2">Description</th>
|
||||
<th align="center" rowspan="2">Output</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="center">Lates</th>
|
||||
<th align="center">News</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>ci4_endsection</td>
|
||||
<td nowrap>ci4:views:endSection</td>
|
||||
<td>Make end Section </td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_extend</td>
|
||||
<td nowrap>ci4:views:extend</td>
|
||||
<td>Using Layouts in Views</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->extend('layouts') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_include</td>
|
||||
<td nowrap>ci4:views:include</td>
|
||||
<td>Including View Partials</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->include('sidebar') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_php</td>
|
||||
<td nowrap>ci4:views:php</td>
|
||||
<td>Make php tag</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_php_echo</td>
|
||||
<td nowrap>ci4:views:php-echo</td>
|
||||
<td>Make php echo tag</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_rendersection</td>
|
||||
<td nowrap>ci4:views:renderSection</td>
|
||||
<td>Make render Section</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->renderSection('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_section</td>
|
||||
<td nowrap>ci4:views:section</td>
|
||||
<td>Make Section</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_sectionend</td>
|
||||
<td nowrap>ci4:views:section-endSection</td>
|
||||
<td>Make Section with end Section</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
<!-- CODE HERE -->
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
### Alternate Snippets for Routes
|
||||
|
||||
### `[ProjectRoot]/app/Config/Routes.php`
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center" colspan="2">Command</th>
|
||||
<th align="center" rowspan="2">Description</th>
|
||||
<th align="center" rowspan="2">Output</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th align="center">Lates</th>
|
||||
<th align="center">News</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>ci4_routes_add</td>
|
||||
<td nowrap>ci4:routes:add</td>
|
||||
<td>Make Routes add() </td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->add('url', 'ControllerName::index');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_cli</td>
|
||||
<td nowrap>ci4:routes:cli</td>
|
||||
<td>Make Command-Line only Routes</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->cli('migrate', 'App\Database::migrate');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_env</td>
|
||||
<td nowrap>ci4:routes:env</td>
|
||||
<td>Make Routes Environment</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->environment('development' , function($routes)
|
||||
{
|
||||
$routes->add('builder','Tools\Builder::index');
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_get</td>
|
||||
<td nowrap>ci4:routes:get</td>
|
||||
<td>Make Routes get()</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->get('url', 'ControllerName::index');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group</td>
|
||||
<td nowrap>ci4:routes:group</td>
|
||||
<td>Make Routes group()</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group_filter</td>
|
||||
<td nowrap>ci4:routes:group-filter</td>
|
||||
<td>Make Routes group() filter</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['filter' => 'api-auth'], function($routes)
|
||||
{
|
||||
$routes->resource('url');
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group_multiple</td>
|
||||
<td nowrap>ci4:routes:group-multiple</td>
|
||||
<td>Make Routes group() multiple</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
$routes->group('users', function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_group_namespace</td>
|
||||
<td nowrap>ci4:routes:group-namespace</td>
|
||||
<td>Make Routes group() namespace</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_post</td>
|
||||
<td nowrap>ci4:routes:post</td>
|
||||
<td>Make Routes post()</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->post('url', 'ControllerName::index');
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td>ci4_routes_subdomain</td>
|
||||
<td nowrap>ci4:routes:subdomain</td>
|
||||
<td>Make Routes Limit to Subdomains</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
$routes->add('from', 'to', ['subdomain' => '*']);
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,208 +1,208 @@
|
|||
### Alternate Snippets for Controllers
|
||||
|
||||
### `[ProjectRoot]/app/Controllers/**.php`
|
||||
|
||||
### Table of Content
|
||||
- [Controllers](#controllers)
|
||||
- [Presenter](#presenter)
|
||||
- [Resources](#resources)
|
||||
- [Request Class](#request-class) <sup style="color:red">New</sup>
|
||||
|
||||
#### Controllers
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller
|
||||
```
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
public function index()
|
||||
{
|
||||
// code
|
||||
}
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
##### Presenter
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller:presenter
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
public function __construct()
|
||||
{
|
||||
// __construct code
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// index code
|
||||
}
|
||||
|
||||
public function show($id = null)
|
||||
{
|
||||
// show code
|
||||
}
|
||||
|
||||
public function new()
|
||||
{
|
||||
// new code
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// create code
|
||||
}
|
||||
|
||||
public function edit($id = null)
|
||||
{
|
||||
// edit code
|
||||
}
|
||||
|
||||
public function update($id = null)
|
||||
{
|
||||
// update code
|
||||
}
|
||||
|
||||
public function remove($id = null)
|
||||
{
|
||||
// remove code
|
||||
}
|
||||
|
||||
public function delete($id = null)
|
||||
{
|
||||
// delete code
|
||||
}
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
##### Resources
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller:resources
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
public function __construct()
|
||||
{
|
||||
// __construct code
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// index code
|
||||
}
|
||||
|
||||
public function show($id = null)
|
||||
{
|
||||
// show code
|
||||
}
|
||||
|
||||
public function new()
|
||||
{
|
||||
// new code
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// create code
|
||||
}
|
||||
|
||||
public function edit($id = null)
|
||||
{
|
||||
// edit code
|
||||
}
|
||||
|
||||
public function update($id = null)
|
||||
{
|
||||
// update code
|
||||
}
|
||||
|
||||
public function delete($id = null)
|
||||
{
|
||||
// delete code
|
||||
}
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
##### Request Class
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller:request
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$this->request->Type('field name');
|
||||
```
|
||||
|
||||
<small>
|
||||
<strong>Type : </strong>getVar, getGet, getPost, getMethod, isAjax, isCLI, isSecure<br>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
### Alternate Snippets for Controllers
|
||||
|
||||
### `[ProjectRoot]/app/Controllers/**.php`
|
||||
|
||||
### Table of Content
|
||||
- [Controllers](#controllers)
|
||||
- [Presenter](#presenter)
|
||||
- [Resources](#resources)
|
||||
- [Request Class](#request-class) <sup style="color:red">New</sup>
|
||||
|
||||
#### Controllers
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller
|
||||
```
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
public function index()
|
||||
{
|
||||
// code
|
||||
}
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
##### Presenter
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller:presenter
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
public function __construct()
|
||||
{
|
||||
// __construct code
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// index code
|
||||
}
|
||||
|
||||
public function show($id = null)
|
||||
{
|
||||
// show code
|
||||
}
|
||||
|
||||
public function new()
|
||||
{
|
||||
// new code
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// create code
|
||||
}
|
||||
|
||||
public function edit($id = null)
|
||||
{
|
||||
// edit code
|
||||
}
|
||||
|
||||
public function update($id = null)
|
||||
{
|
||||
// update code
|
||||
}
|
||||
|
||||
public function remove($id = null)
|
||||
{
|
||||
// remove code
|
||||
}
|
||||
|
||||
public function delete($id = null)
|
||||
{
|
||||
// delete code
|
||||
}
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
##### Resources
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller:resources
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
public function __construct()
|
||||
{
|
||||
// __construct code
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// index code
|
||||
}
|
||||
|
||||
public function show($id = null)
|
||||
{
|
||||
// show code
|
||||
}
|
||||
|
||||
public function new()
|
||||
{
|
||||
// new code
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
// create code
|
||||
}
|
||||
|
||||
public function edit($id = null)
|
||||
{
|
||||
// edit code
|
||||
}
|
||||
|
||||
public function update($id = null)
|
||||
{
|
||||
// update code
|
||||
}
|
||||
|
||||
public function delete($id = null)
|
||||
{
|
||||
// delete code
|
||||
}
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
##### Request Class
|
||||
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RENDERS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:controller:request
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$this->request->Type('field name');
|
||||
```
|
||||
|
||||
<small>
|
||||
<strong>Type : </strong>getVar, getGet, getPost, getMethod, isAjax, isCLI, isSecure<br>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,245 +1,245 @@
|
|||
# Alternate Snippets for Migrations
|
||||
|
||||
## `[ProjectRoot]/app/Database/Migrations/`
|
||||
|
||||
# Table of Content
|
||||
|
||||
- [Create Migration](#create-migration)
|
||||
- [Migration Up](#migration-up)
|
||||
- [Migration Down](#migration-down)
|
||||
- [Create Table](#create-table)
|
||||
- [Add Column](#add-column) [new]
|
||||
- [BIGINT](#bigint) [new]
|
||||
- [CHAR](#char) [new]
|
||||
- [DATETIME](#datetime) [new]
|
||||
- [INT](#int) [new]
|
||||
- [VARCHAR](#varchar) [new]
|
||||
- [ID](#id) [new]
|
||||
- [Timestamp](#timestamp)
|
||||
|
||||
## Create Migration
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddBlog extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- ### Migration Up
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:up
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField([
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
],
|
||||
'created_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
]);
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->createTable('tableName');
|
||||
}
|
||||
```
|
||||
|
||||
- ### Migration Down
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:down
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable('tableName');
|
||||
}
|
||||
```
|
||||
|
||||
## Create Table
|
||||
|
||||
- ### Add Column
|
||||
|
||||
- #### BIGINT
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:bigint
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'BIGINT',
|
||||
'constraint' => '20',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### CHAR
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:char
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'CHAR',
|
||||
'constraint' => '10',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### DATETIME
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:datetime
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### INT
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:int
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => '11',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### VARCHAR
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:varchar
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- ### ID
|
||||
|
||||
**Command :**
|
||||
|
||||
```bash
|
||||
ci4:migration:id
|
||||
```
|
||||
|
||||
**Output :**
|
||||
|
||||
```php
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- ### Timestamp
|
||||
|
||||
**Command :**
|
||||
|
||||
```bash
|
||||
ci4:migration:timestamp
|
||||
```
|
||||
|
||||
**Output :**
|
||||
|
||||
```php
|
||||
'created_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
# Alternate Snippets for Migrations
|
||||
|
||||
## `[ProjectRoot]/app/Database/Migrations/`
|
||||
|
||||
# Table of Content
|
||||
|
||||
- [Create Migration](#create-migration)
|
||||
- [Migration Up](#migration-up)
|
||||
- [Migration Down](#migration-down)
|
||||
- [Create Table](#create-table)
|
||||
- [Add Column](#add-column) [new]
|
||||
- [BIGINT](#bigint) [new]
|
||||
- [CHAR](#char) [new]
|
||||
- [DATETIME](#datetime) [new]
|
||||
- [INT](#int) [new]
|
||||
- [VARCHAR](#varchar) [new]
|
||||
- [ID](#id) [new]
|
||||
- [Timestamp](#timestamp)
|
||||
|
||||
## Create Migration
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class AddBlog extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- ### Migration Up
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:up
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField([
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
'name' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => 255,
|
||||
],
|
||||
'created_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
]);
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->createTable('tableName');
|
||||
}
|
||||
```
|
||||
|
||||
- ### Migration Down
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:down
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable('tableName');
|
||||
}
|
||||
```
|
||||
|
||||
## Create Table
|
||||
|
||||
- ### Add Column
|
||||
|
||||
- #### BIGINT
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:bigint
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'BIGINT',
|
||||
'constraint' => '20',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### CHAR
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:char
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'CHAR',
|
||||
'constraint' => '10',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### DATETIME
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:datetime
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### INT
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:int
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => '11',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- #### VARCHAR
|
||||
|
||||
**Command**
|
||||
|
||||
```bash
|
||||
ci4:migration:varchar
|
||||
```
|
||||
|
||||
**Output**
|
||||
|
||||
```php
|
||||
'columnName' => [
|
||||
'type' => 'VARCHAR',
|
||||
'constraint' => '255',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- ### ID
|
||||
|
||||
**Command :**
|
||||
|
||||
```bash
|
||||
ci4:migration:id
|
||||
```
|
||||
|
||||
**Output :**
|
||||
|
||||
```php
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'constraint' => 11,
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true,
|
||||
],
|
||||
```
|
||||
|
||||
- ### Timestamp
|
||||
|
||||
**Command :**
|
||||
|
||||
```bash
|
||||
ci4:migration:timestamp
|
||||
```
|
||||
|
||||
**Output :**
|
||||
|
||||
```php
|
||||
'created_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'updated_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
'deleted_at' => [
|
||||
'type' => 'DATETIME',
|
||||
'null' => true,
|
||||
],
|
||||
```
|
|
@ -1,36 +1,36 @@
|
|||
### Alternate Snippets for Models
|
||||
|
||||
### `[ProjectRoot]/app/Models/*.php`
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [Model Config](#model-config) [new]
|
||||
|
||||
#### Model Config
|
||||
|
||||
- Command
|
||||
```bash
|
||||
ci4:model:config
|
||||
```
|
||||
- Output
|
||||
|
||||
```php
|
||||
protected $table = 'tableName';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = true;
|
||||
|
||||
protected $allowedFields = ['name'];
|
||||
|
||||
protected $useTimestamps = false;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
```
|
||||
### Alternate Snippets for Models
|
||||
|
||||
### `[ProjectRoot]/app/Models/*.php`
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [Model Config](#model-config) [new]
|
||||
|
||||
#### Model Config
|
||||
|
||||
- Command
|
||||
```bash
|
||||
ci4:model:config
|
||||
```
|
||||
- Output
|
||||
|
||||
```php
|
||||
protected $table = 'tableName';
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = true;
|
||||
|
||||
protected $allowedFields = ['name'];
|
||||
|
||||
protected $useTimestamps = false;
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
protected $skipValidation = false;
|
||||
```
|
|
@ -1,319 +1,319 @@
|
|||
### Alternate Snippets for Routes
|
||||
|
||||
### `[ProjectRoot]/app/Config/Routes.php`
|
||||
|
||||
### Table of Content
|
||||
<!-- - [Alternate Snippets for Routes](#alternate-snippets-for-routes)
|
||||
- [`[ProjectRoot]/app/Config/Routes.php`](#projectrootappconfigroutesphp)
|
||||
- [Table of Content](#table-of-content) -->
|
||||
- [Routes](#routes)
|
||||
- [Placeholders](#placeholders)
|
||||
- [Custom Placeholders](#custom-placeholders)
|
||||
- [Presenter](#presenter)
|
||||
- [Resource](#resource)
|
||||
|
||||
### Routes
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:add
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->add('url', 'ControllerName::index');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:cli
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->cli('migrate', 'App\Database::migrate');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:env
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->environment('development' , function($routes)
|
||||
{
|
||||
$routes->add('builder','Tools\Builder::index');
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:get
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->get('url', 'ControllerName::index');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
$routes->add('url', 'ControllerName::index');
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group-filter
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['filter' => 'api-auth'], function($routes)
|
||||
{
|
||||
$routes->resource('url');
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group-multiple
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
$routes->group('users', function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group-namespace
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:post
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->post('url', 'ControllerName::index');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:subdomain
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->add('from', 'to', ['subdomain' => '*']);
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Placeholders
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:placeholder
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->type('url/(:placeholder)', 'ControllerName::index/$1');
|
||||
```
|
||||
<small>
|
||||
<strong>Type : </strong>add, get, post, put, delete<br>
|
||||
<strong>Placeholder : </strong>any, segment, num, alpha, alphanum, hash<br>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Custom Placeholders
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:placeholder:custom
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```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->type('url/(:uuid)', 'ControllerName::index/$1');
|
||||
```
|
||||
<small>
|
||||
<strong>Type : </strong>add, get, post, put, delete<br>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Presenter
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:presenter
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->presenter('url');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Resource
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:resource
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->resource('url');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
### Alternate Snippets for Routes
|
||||
|
||||
### `[ProjectRoot]/app/Config/Routes.php`
|
||||
|
||||
### Table of Content
|
||||
<!-- - [Alternate Snippets for Routes](#alternate-snippets-for-routes)
|
||||
- [`[ProjectRoot]/app/Config/Routes.php`](#projectrootappconfigroutesphp)
|
||||
- [Table of Content](#table-of-content) -->
|
||||
- [Routes](#routes)
|
||||
- [Placeholders](#placeholders)
|
||||
- [Custom Placeholders](#custom-placeholders)
|
||||
- [Presenter](#presenter)
|
||||
- [Resource](#resource)
|
||||
|
||||
### Routes
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:add
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->add('url', 'ControllerName::index');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:cli
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->cli('migrate', 'App\Database::migrate');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:env
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->environment('development' , function($routes)
|
||||
{
|
||||
$routes->add('builder','Tools\Builder::index');
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:get
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->get('url', 'ControllerName::index');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
$routes->add('url', 'ControllerName::index');
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group-filter
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['filter' => 'api-auth'], function($routes)
|
||||
{
|
||||
$routes->resource('url');
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group-multiple
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('admin', function($routes)
|
||||
{
|
||||
$routes->group('users', function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:group-namespace
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->group('api' , ['namespace' => 'App\API\v1'], function($routes)
|
||||
{
|
||||
//Route
|
||||
});
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:post
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->post('url', 'ControllerName::index');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:subdomain
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->add('from', 'to', ['subdomain' => '*']);
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Placeholders
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:placeholder
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->type('url/(:placeholder)', 'ControllerName::index/$1');
|
||||
```
|
||||
<small>
|
||||
<strong>Type : </strong>add, get, post, put, delete<br>
|
||||
<strong>Placeholder : </strong>any, segment, num, alpha, alphanum, hash<br>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Custom Placeholders
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:placeholder:custom
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```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->type('url/(:uuid)', 'ControllerName::index/$1');
|
||||
```
|
||||
<small>
|
||||
<strong>Type : </strong>add, get, post, put, delete<br>
|
||||
</small>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Presenter
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:presenter
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->presenter('url');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
#### Resource
|
||||
<table style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">COMMANDS</th>
|
||||
<th align="center">RESULTS</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap style="vertical-align: top;">
|
||||
|
||||
```code
|
||||
ci4:routes:resource
|
||||
```
|
||||
|
||||
</td>
|
||||
<td nowrap>
|
||||
|
||||
```php
|
||||
$routes->resource('url');
|
||||
```
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,34 +1,34 @@
|
|||
### Alternate Snippets for Validation
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [Alternate Snippets for Validation](#alternate-snippets-for-validation)
|
||||
- [Table of Content](#table-of-content)
|
||||
- [Validation](#validation)
|
||||
- [Validation in Controller](#validation-in-controller)
|
||||
|
||||
### Validation
|
||||
|
||||
#### Validation in Controller
|
||||
|
||||
- Command
|
||||
```code
|
||||
ci4:validation:controller
|
||||
```
|
||||
- Output
|
||||
|
||||
```php
|
||||
$validation = \Config\Services::validation();
|
||||
$rules = [
|
||||
'field_1' => [
|
||||
'label' => 'Field 1 Custom Name',
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => '{field} is required.'
|
||||
]
|
||||
],
|
||||
];
|
||||
if (!$this->validate($rules)) {
|
||||
return redirect()->to('/route')->withInput()->with('validation', $validation);
|
||||
}
|
||||
### Alternate Snippets for Validation
|
||||
|
||||
### Table of Content
|
||||
|
||||
- [Alternate Snippets for Validation](#alternate-snippets-for-validation)
|
||||
- [Table of Content](#table-of-content)
|
||||
- [Validation](#validation)
|
||||
- [Validation in Controller](#validation-in-controller)
|
||||
|
||||
### Validation
|
||||
|
||||
#### Validation in Controller
|
||||
|
||||
- Command
|
||||
```code
|
||||
ci4:validation:controller
|
||||
```
|
||||
- Output
|
||||
|
||||
```php
|
||||
$validation = \Config\Services::validation();
|
||||
$rules = [
|
||||
'field_1' => [
|
||||
'label' => 'Field 1 Custom Name',
|
||||
'rules' => 'required',
|
||||
'errors' => [
|
||||
'required' => '{field} is required.'
|
||||
]
|
||||
],
|
||||
];
|
||||
if (!$this->validate($rules)) {
|
||||
return redirect()->to('/route')->withInput()->with('validation', $validation);
|
||||
}
|
||||
```
|
|
@ -1,190 +1,190 @@
|
|||
### Alternate Snippets for View Files
|
||||
|
||||
### `[ProjectRoot]/app/Views/**.php`
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Command</th>
|
||||
<th align="center">Description</th>
|
||||
<th align="center">Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap>ci4:views:endSection</td>
|
||||
<td>Make end Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:extend</td>
|
||||
<td>Using Layouts in Views</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->extend('layouts') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:foreach</td>
|
||||
<td>Make <code>foreach</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php foreach ($items as $item) : ?>
|
||||
<li><?= $item ?></li>
|
||||
<?php endforeach ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if</td>
|
||||
<td>Make <code>if</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-else</td>
|
||||
<td>Make <code>if else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif</td>
|
||||
<td>Make <code>if elseif</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif-else</td>
|
||||
<td>Make <code>if elseif else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE 1 -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- TRUE 2 -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:include</td>
|
||||
<td>Including View Partials</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->include('sidebar') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:php</td>
|
||||
<td>Make php tag in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:php-echo</td>
|
||||
<td>Make php echo tag in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:renderSection</td>
|
||||
<td>Make render Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->renderSection('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:section</td>
|
||||
<td>Make Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:section-endSection</td>
|
||||
<td>Make Section with end Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
<!-- CODE HERE -->
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
### Alternate Snippets for View Files
|
||||
|
||||
### `[ProjectRoot]/app/Views/**.php`
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Command</th>
|
||||
<th align="center">Description</th>
|
||||
<th align="center">Output</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td nowrap>ci4:views:endSection</td>
|
||||
<td>Make end Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:extend</td>
|
||||
<td>Using Layouts in Views</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->extend('layouts') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:foreach</td>
|
||||
<td>Make <code>foreach</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php foreach ($items as $item) : ?>
|
||||
<li><?= $item ?></li>
|
||||
<?php endforeach ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if</td>
|
||||
<td>Make <code>if</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-else</td>
|
||||
<td>Make <code>if else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif</td>
|
||||
<td>Make <code>if elseif</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:if-elseif-else</td>
|
||||
<td>Make <code>if elseif else</code> in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php if (condition) : ?>
|
||||
<!-- TRUE 1 -->
|
||||
<?php elseif (condition) : ?>
|
||||
<!-- TRUE 2 -->
|
||||
<?php else : ?>
|
||||
<!-- FALSE -->
|
||||
<?php endif ?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:include</td>
|
||||
<td>Including View Partials</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->include('sidebar') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:php</td>
|
||||
<td>Make php tag in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?php code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:php-echo</td>
|
||||
<td>Make php echo tag in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= code ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:renderSection</td>
|
||||
<td>Make render Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->renderSection('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:section</td>
|
||||
<td>Make Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<!-- -->
|
||||
<tr>
|
||||
<td nowrap>ci4:views:section-endSection</td>
|
||||
<td>Make Section with end Section in View files</td>
|
||||
<td>
|
||||
|
||||
```php
|
||||
<?= $this->section('content') ;?>
|
||||
<!-- CODE HERE -->
|
||||
<?= $this->endSection() ;?>
|
||||
```
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
|
@ -1,51 +1,51 @@
|
|||
{
|
||||
"name": "codeigniter4-snippets",
|
||||
"displayName": "CodeIgniter4 Snippets",
|
||||
"description": "CodeIgniter4 Snippets for Visual Studio Code",
|
||||
"icon": "ci4.png",
|
||||
"publisher": "adereksisusanto",
|
||||
"version": "0.1.1",
|
||||
"engines": {
|
||||
"vscode": "^1.53.0"
|
||||
},
|
||||
"keywords": [
|
||||
"codeigniter4",
|
||||
"snippets",
|
||||
"php",
|
||||
"html"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/adereksisusanto/codeigniter4-snippets"
|
||||
},
|
||||
"categories": [
|
||||
"Snippets"
|
||||
],
|
||||
"contributes": {
|
||||
"snippets": [{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_controllers.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_models.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_migrations.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_routes.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_validations.json"
|
||||
},
|
||||
{
|
||||
"language": "html",
|
||||
"path": "./snippets/html_views.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"name": "codeigniter4-snippets",
|
||||
"displayName": "CodeIgniter4 Snippets",
|
||||
"description": "CodeIgniter4 Snippets for Visual Studio Code",
|
||||
"icon": "ci4.png",
|
||||
"publisher": "adereksisusanto",
|
||||
"version": "0.1.1",
|
||||
"engines": {
|
||||
"vscode": "^1.53.0"
|
||||
},
|
||||
"keywords": [
|
||||
"codeigniter4",
|
||||
"snippets",
|
||||
"php",
|
||||
"html"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/adereksisusanto/codeigniter4-snippets"
|
||||
},
|
||||
"categories": [
|
||||
"Snippets"
|
||||
],
|
||||
"contributes": {
|
||||
"snippets": [{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_controllers.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_models.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_migrations.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_routes.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets/php_validations.json"
|
||||
},
|
||||
{
|
||||
"language": "html",
|
||||
"path": "./snippets/html_views.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -1,113 +1,113 @@
|
|||
{
|
||||
"Codeigniter4_VIEWS_ENDSECTION": {
|
||||
"prefix": "ci4:views:endSection",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->endSection() ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make end Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_EXTEND": {
|
||||
"prefix": "ci4:views:extend",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->extend('${1:layouts}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Using Layouts in Views"
|
||||
},
|
||||
"Codeigniter4_VIEWS_FOREACH": {
|
||||
"prefix": "ci4:views:foreach",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php foreach (${1:\\$items} as ${2:\\$item}) : ?>",
|
||||
"\t<${3:li}><?= ${4:\\$item}['${5:id}'] ?></${3:li}>",
|
||||
"<?php endforeach ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make foreach in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF": {
|
||||
"prefix": "ci4:views:if",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if (${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSE": {
|
||||
"prefix": "ci4:views:if-else",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if (${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php else : ?>",
|
||||
"\t${3:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if else in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSEIF": {
|
||||
"prefix": "ci4:views:if-elseif",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if(${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php elseif (${3:condition}) : ?>",
|
||||
"\t${4:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if elseif in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSEIF_ELSE": {
|
||||
"prefix": "ci4:views:if-elseif-else",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if(${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE 1 -->}",
|
||||
"<?php elseif (${3:condition}) : ?>",
|
||||
"\t${4:<!-- TRUE 2 -->}",
|
||||
"<?php else : ?>",
|
||||
"\t${5:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - make if elseif else in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_INCLUDE": {
|
||||
"prefix": "ci4:views:include",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->include('${1:sidebar}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Including View Partials"
|
||||
},
|
||||
"Codeigniter4_VIEWS_PHP": {
|
||||
"prefix": "ci4:views:php",
|
||||
"lang": ["html"],
|
||||
"body": ["<?php ${1:code} ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make php tag in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_PHP_ECHO": {
|
||||
"prefix": "ci4:views:php-echo",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= ${1:code} ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make php echo tag in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_RENDERSECTION": {
|
||||
"prefix": "ci4:views:renderSection",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->renderSection('${1:content}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make render Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_SECTION": {
|
||||
"prefix": "ci4:views:section",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->section('${1:content}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_SECTION_ENDSECTION": {
|
||||
"prefix": "ci4:views:section-endSection",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?= \\$this->section('${1:content}') ;?>",
|
||||
"${2:<!-- CODE HERE -->}",
|
||||
"<?= \\$this->endSection() ;?>",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Section with end Section in View files"
|
||||
}
|
||||
}
|
||||
{
|
||||
"Codeigniter4_VIEWS_ENDSECTION": {
|
||||
"prefix": "ci4:views:endSection",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->endSection() ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make end Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_EXTEND": {
|
||||
"prefix": "ci4:views:extend",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->extend('${1:layouts}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Using Layouts in Views"
|
||||
},
|
||||
"Codeigniter4_VIEWS_FOREACH": {
|
||||
"prefix": "ci4:views:foreach",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php foreach (${1:\\$items} as ${2:\\$item}) : ?>",
|
||||
"\t<${3:li}><?= ${4:\\$item}['${5:id}'] ?></${3:li}>",
|
||||
"<?php endforeach ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make foreach in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF": {
|
||||
"prefix": "ci4:views:if",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if (${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSE": {
|
||||
"prefix": "ci4:views:if-else",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if (${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php else : ?>",
|
||||
"\t${3:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if else in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSEIF": {
|
||||
"prefix": "ci4:views:if-elseif",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if(${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE -->}",
|
||||
"<?php elseif (${3:condition}) : ?>",
|
||||
"\t${4:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make if elseif in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_IF_ELSEIF_ELSE": {
|
||||
"prefix": "ci4:views:if-elseif-else",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?php if(${1:condition}) : ?>",
|
||||
"\t${2:<!-- TRUE 1 -->}",
|
||||
"<?php elseif (${3:condition}) : ?>",
|
||||
"\t${4:<!-- TRUE 2 -->}",
|
||||
"<?php else : ?>",
|
||||
"\t${5:<!-- FALSE -->}",
|
||||
"<?php endif ?>$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - make if elseif else in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_INCLUDE": {
|
||||
"prefix": "ci4:views:include",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->include('${1:sidebar}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Including View Partials"
|
||||
},
|
||||
"Codeigniter4_VIEWS_PHP": {
|
||||
"prefix": "ci4:views:php",
|
||||
"lang": ["html"],
|
||||
"body": ["<?php ${1:code} ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make php tag in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_PHP_ECHO": {
|
||||
"prefix": "ci4:views:php-echo",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= ${1:code} ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make php echo tag in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_RENDERSECTION": {
|
||||
"prefix": "ci4:views:renderSection",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->renderSection('${1:content}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make render Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_SECTION": {
|
||||
"prefix": "ci4:views:section",
|
||||
"lang": ["html"],
|
||||
"body": ["<?= \\$this->section('${1:content}') ;?>$0"],
|
||||
"description": "CodeIgniter 4 - Make Section in View files"
|
||||
},
|
||||
"Codeigniter4_VIEWS_SECTION_ENDSECTION": {
|
||||
"prefix": "ci4:views:section-endSection",
|
||||
"lang": ["html"],
|
||||
"body": [
|
||||
"<?= \\$this->section('${1:content}') ;?>",
|
||||
"${2:<!-- CODE HERE -->}",
|
||||
"<?= \\$this->endSection() ;?>",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Section with end Section in View files"
|
||||
}
|
||||
}
|
|
@ -1,118 +1,118 @@
|
|||
{
|
||||
"Codeigniter4_Controller": {
|
||||
"prefix": "ci4:controller",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function ${1:index}(${2:\\$request})",
|
||||
"{",
|
||||
"\t\\\\${3:code}",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller"
|
||||
},
|
||||
"Codeigniter4_Controller_Resources": {
|
||||
"prefix": "ci4:controller:resources",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function __construct()",
|
||||
"{",
|
||||
"\t\\\\__construct code",
|
||||
"}",
|
||||
"",
|
||||
"public function index()",
|
||||
"{",
|
||||
"\t\\\\index code",
|
||||
"}",
|
||||
"",
|
||||
"public function show(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\show code",
|
||||
"}",
|
||||
"",
|
||||
"public function new()",
|
||||
"{",
|
||||
"\t\\\\new code",
|
||||
"}",
|
||||
"",
|
||||
"public function create()",
|
||||
"{",
|
||||
"\t\\\\create code",
|
||||
"}",
|
||||
"",
|
||||
"public function edit(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\edit code",
|
||||
"}",
|
||||
"",
|
||||
"public function update(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\update code",
|
||||
"}",
|
||||
"",
|
||||
"public function delete(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\delete code",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller Resources"
|
||||
},
|
||||
"Codeigniter4_Controller_Presenter": {
|
||||
"prefix": "ci4:controller:presenter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function __construct()",
|
||||
"{",
|
||||
"\t\\__construct code",
|
||||
"}",
|
||||
"",
|
||||
"public function index()",
|
||||
"{",
|
||||
"\t\\index code",
|
||||
"}",
|
||||
"",
|
||||
"public function show(\\$id = null)",
|
||||
"{",
|
||||
"\t\\show code",
|
||||
"}",
|
||||
"",
|
||||
"public function new()",
|
||||
"{",
|
||||
"\t\\new code",
|
||||
"}",
|
||||
"",
|
||||
"public function create()",
|
||||
"{",
|
||||
"\t\\create code",
|
||||
"}",
|
||||
"",
|
||||
"public function edit(\\$id = null)",
|
||||
"{",
|
||||
"\t\\edit code",
|
||||
"}",
|
||||
"",
|
||||
"public function update(\\$id = null)",
|
||||
"{",
|
||||
"\t\\update code",
|
||||
"}",
|
||||
"",
|
||||
"public function remove(\\$id = null)",
|
||||
"{",
|
||||
"\t\\remove code",
|
||||
"}",
|
||||
"",
|
||||
"public function delete(\\$id = null)",
|
||||
"{",
|
||||
"\t\\delete code",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controler Presenter"
|
||||
},
|
||||
"Codeigniter4_Controller_Request": {
|
||||
"prefix": "ci4:controller:request",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$this->request->${1|getVar,getGet,getPost,getMethod,isAjax,isCLI,isSecure|}('${2:field name}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller Request Class"
|
||||
}
|
||||
{
|
||||
"Codeigniter4_Controller": {
|
||||
"prefix": "ci4:controller",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function ${1:index}(${2:\\$request})",
|
||||
"{",
|
||||
"\t\\\\${3:code}",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller"
|
||||
},
|
||||
"Codeigniter4_Controller_Resources": {
|
||||
"prefix": "ci4:controller:resources",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function __construct()",
|
||||
"{",
|
||||
"\t\\\\__construct code",
|
||||
"}",
|
||||
"",
|
||||
"public function index()",
|
||||
"{",
|
||||
"\t\\\\index code",
|
||||
"}",
|
||||
"",
|
||||
"public function show(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\show code",
|
||||
"}",
|
||||
"",
|
||||
"public function new()",
|
||||
"{",
|
||||
"\t\\\\new code",
|
||||
"}",
|
||||
"",
|
||||
"public function create()",
|
||||
"{",
|
||||
"\t\\\\create code",
|
||||
"}",
|
||||
"",
|
||||
"public function edit(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\edit code",
|
||||
"}",
|
||||
"",
|
||||
"public function update(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\update code",
|
||||
"}",
|
||||
"",
|
||||
"public function delete(\\$id = null)",
|
||||
"{",
|
||||
"\t\\\\delete code",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller Resources"
|
||||
},
|
||||
"Codeigniter4_Controller_Presenter": {
|
||||
"prefix": "ci4:controller:presenter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function __construct()",
|
||||
"{",
|
||||
"\t\\__construct code",
|
||||
"}",
|
||||
"",
|
||||
"public function index()",
|
||||
"{",
|
||||
"\t\\index code",
|
||||
"}",
|
||||
"",
|
||||
"public function show(\\$id = null)",
|
||||
"{",
|
||||
"\t\\show code",
|
||||
"}",
|
||||
"",
|
||||
"public function new()",
|
||||
"{",
|
||||
"\t\\new code",
|
||||
"}",
|
||||
"",
|
||||
"public function create()",
|
||||
"{",
|
||||
"\t\\create code",
|
||||
"}",
|
||||
"",
|
||||
"public function edit(\\$id = null)",
|
||||
"{",
|
||||
"\t\\edit code",
|
||||
"}",
|
||||
"",
|
||||
"public function update(\\$id = null)",
|
||||
"{",
|
||||
"\t\\update code",
|
||||
"}",
|
||||
"",
|
||||
"public function remove(\\$id = null)",
|
||||
"{",
|
||||
"\t\\remove code",
|
||||
"}",
|
||||
"",
|
||||
"public function delete(\\$id = null)",
|
||||
"{",
|
||||
"\t\\delete code",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controler Presenter"
|
||||
},
|
||||
"Codeigniter4_Controller_Request": {
|
||||
"prefix": "ci4:controller:request",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$this->request->${1|getVar,getGet,getPost,getMethod,isAjax,isCLI,isSecure|}('${2:field name}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Controller Request Class"
|
||||
}
|
||||
}
|
|
@ -1,165 +1,165 @@
|
|||
{
|
||||
"Codeigniter4_Migration": {
|
||||
"prefix": "ci4:migration",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App\\\\Database\\\\Migrations;",
|
||||
"",
|
||||
"use CodeIgniter\\\\Database\\\\Migration;",
|
||||
"",
|
||||
"class ${1:AddBlog} extends Migration",
|
||||
"{",
|
||||
"\tpublic function up()",
|
||||
"\t{",
|
||||
"\t\t$2",
|
||||
"\t}",
|
||||
"",
|
||||
"\tpublic function down()",
|
||||
"\t{",
|
||||
"\t\t$3",
|
||||
"\t}",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration"
|
||||
},
|
||||
"Codeigniter4_Migration_Up": {
|
||||
"prefix": "ci4:migration:up",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function up()",
|
||||
"{",
|
||||
"\t\\$this->forge->addField([",
|
||||
"\t\t'${1:id}' => [",
|
||||
"\t\t\t'type' => 'INT',",
|
||||
"\t\t\t'constraint' => 11,",
|
||||
"\t\t\t'unsigned' => true,",
|
||||
"\t\t\t'auto_increment' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'${2:name}' => [",
|
||||
"\t\t\t'type' => 'VARCHAR',",
|
||||
"\t\t\t'constraint' => 255,",
|
||||
"\t\t],",
|
||||
"\t\t'created_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'updated_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'deleted_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t]);",
|
||||
"\t\\$this->forge->addKey('${1:id}', true);",
|
||||
"\t\\$this->forge->createTable('${3:tableName}');",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Up"
|
||||
},
|
||||
"Codeigniter4_Migration_Down": {
|
||||
"prefix": "ci4:migration:down",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function down()",
|
||||
"{",
|
||||
"\t\\$this->forge->dropTable('${1:tableName}');",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Down"
|
||||
},
|
||||
"Codeigniter4_Migration_BIGINT": {
|
||||
"prefix": "ci4:migration:bigint",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'BIGINT',",
|
||||
"\t'constraint' => 20,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (BIG INTEGER)"
|
||||
},
|
||||
"Codeigniter4_Migration_CHAR": {
|
||||
"prefix": "ci4:migration:char",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'CHAR',",
|
||||
"\t'constraint' => 10,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (CHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_DATETIME": {
|
||||
"prefix": "ci4:migration:datetime",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (CHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_INT": {
|
||||
"prefix": "ci4:migration:int",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'INT',",
|
||||
"\t'constraint' => 11,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (INTEGER)"
|
||||
},
|
||||
"Codeigniter4_Migration_VARCHAR": {
|
||||
"prefix": "ci4:migration:varchar",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'VARCHAR',",
|
||||
"\t'constraint' => 255,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (VARCHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_ID": {
|
||||
"prefix": "ci4:migration:id",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'id' => [",
|
||||
"\t'type' => 'INT',",
|
||||
"\t'constraint' => 11,",
|
||||
"\t'unsigned' => true,",
|
||||
"\t'auto_increment' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration ID"
|
||||
},
|
||||
"Codeigniter4_Migration_Timestamp": {
|
||||
"prefix": "ci4:migration:timestamp",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'created_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],",
|
||||
"'updated_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],",
|
||||
"'deleted_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Timestamp"
|
||||
}
|
||||
}
|
||||
{
|
||||
"Codeigniter4_Migration": {
|
||||
"prefix": "ci4:migration",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"<?php",
|
||||
"",
|
||||
"namespace App\\\\Database\\\\Migrations;",
|
||||
"",
|
||||
"use CodeIgniter\\\\Database\\\\Migration;",
|
||||
"",
|
||||
"class ${1:AddBlog} extends Migration",
|
||||
"{",
|
||||
"\tpublic function up()",
|
||||
"\t{",
|
||||
"\t\t$2",
|
||||
"\t}",
|
||||
"",
|
||||
"\tpublic function down()",
|
||||
"\t{",
|
||||
"\t\t$3",
|
||||
"\t}",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration"
|
||||
},
|
||||
"Codeigniter4_Migration_Up": {
|
||||
"prefix": "ci4:migration:up",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function up()",
|
||||
"{",
|
||||
"\t\\$this->forge->addField([",
|
||||
"\t\t'${1:id}' => [",
|
||||
"\t\t\t'type' => 'INT',",
|
||||
"\t\t\t'constraint' => 11,",
|
||||
"\t\t\t'unsigned' => true,",
|
||||
"\t\t\t'auto_increment' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'${2:name}' => [",
|
||||
"\t\t\t'type' => 'VARCHAR',",
|
||||
"\t\t\t'constraint' => 255,",
|
||||
"\t\t],",
|
||||
"\t\t'created_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'updated_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t\t'deleted_at' => [",
|
||||
"\t\t\t'type' => 'DATETIME',",
|
||||
"\t\t\t'null' => true,",
|
||||
"\t\t],",
|
||||
"\t]);",
|
||||
"\t\\$this->forge->addKey('${1:id}', true);",
|
||||
"\t\\$this->forge->createTable('${3:tableName}');",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Up"
|
||||
},
|
||||
"Codeigniter4_Migration_Down": {
|
||||
"prefix": "ci4:migration:down",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"public function down()",
|
||||
"{",
|
||||
"\t\\$this->forge->dropTable('${1:tableName}');",
|
||||
"}$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Down"
|
||||
},
|
||||
"Codeigniter4_Migration_BIGINT": {
|
||||
"prefix": "ci4:migration:bigint",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'BIGINT',",
|
||||
"\t'constraint' => 20,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (BIG INTEGER)"
|
||||
},
|
||||
"Codeigniter4_Migration_CHAR": {
|
||||
"prefix": "ci4:migration:char",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'CHAR',",
|
||||
"\t'constraint' => 10,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (CHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_DATETIME": {
|
||||
"prefix": "ci4:migration:datetime",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (CHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_INT": {
|
||||
"prefix": "ci4:migration:int",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'INT',",
|
||||
"\t'constraint' => 11,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (INTEGER)"
|
||||
},
|
||||
"Codeigniter4_Migration_VARCHAR": {
|
||||
"prefix": "ci4:migration:varchar",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'${1:columnName}' => [",
|
||||
"\t'type' => 'VARCHAR',",
|
||||
"\t'constraint' => 255,",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Type (VARCHAR)"
|
||||
},
|
||||
"Codeigniter4_Migration_ID": {
|
||||
"prefix": "ci4:migration:id",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'id' => [",
|
||||
"\t'type' => 'INT',",
|
||||
"\t'constraint' => 11,",
|
||||
"\t'unsigned' => true,",
|
||||
"\t'auto_increment' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration ID"
|
||||
},
|
||||
"Codeigniter4_Migration_Timestamp": {
|
||||
"prefix": "ci4:migration:timestamp",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"'created_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],",
|
||||
"'updated_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],",
|
||||
"'deleted_at' => [",
|
||||
"\t'type' => 'DATETIME',",
|
||||
"\t'null' => true,",
|
||||
"],$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Migration Timestamp"
|
||||
}
|
||||
}
|
|
@ -1,28 +1,28 @@
|
|||
{
|
||||
"Codeigniter4_Model_Config": {
|
||||
"prefix": "ci4:model:config",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"protected \\$table = '${1:tableName}';",
|
||||
"protected \\$primaryKey = '${2:id}';",
|
||||
"",
|
||||
"protected \\$useAutoIncrement = ${3:true};",
|
||||
"",
|
||||
"protected \\$returnType = '${4:array}';",
|
||||
"protected \\$useSoftDeletes = ${5:false};",
|
||||
"",
|
||||
"protected \\$allowedFields = ['${6:name}'];",
|
||||
"",
|
||||
"protected \\$useTimestamps = ${7:true};",
|
||||
"protected \\$createdField = '${8:created_at}';",
|
||||
"protected \\$updatedField = '${9:updated_at}';",
|
||||
"protected \\$useTimestamps = '${10:deleted_at}';",
|
||||
"",
|
||||
"protected \\$validationRules = ${11:[]};",
|
||||
"protected \\$validationMessages = ${12:[]};",
|
||||
"protected \\$skipValidation = ${13:false};",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Model Configuring"
|
||||
}
|
||||
}
|
||||
{
|
||||
"Codeigniter4_Model_Config": {
|
||||
"prefix": "ci4:model:config",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"protected \\$table = '${1:tableName}';",
|
||||
"protected \\$primaryKey = '${2:id}';",
|
||||
"",
|
||||
"protected \\$useAutoIncrement = ${3:true};",
|
||||
"",
|
||||
"protected \\$returnType = '${4:array}';",
|
||||
"protected \\$useSoftDeletes = ${5:false};",
|
||||
"",
|
||||
"protected \\$allowedFields = ['${6:name}'];",
|
||||
"",
|
||||
"protected \\$useTimestamps = ${7:true};",
|
||||
"protected \\$createdField = '${8:created_at}';",
|
||||
"protected \\$updatedField = '${9:updated_at}';",
|
||||
"protected \\$useTimestamps = '${10:deleted_at}';",
|
||||
"",
|
||||
"protected \\$validationRules = ${11:[]};",
|
||||
"protected \\$validationMessages = ${12:[]};",
|
||||
"protected \\$skipValidation = ${13:false};",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Model Configuring"
|
||||
}
|
||||
}
|
|
@ -1,129 +1,129 @@
|
|||
{
|
||||
"Codeigniter4_ROUTES_ADD": {
|
||||
"prefix": "ci4:routes:add",
|
||||
"lang": ["php"],
|
||||
"body": ["\\$routes->add('${1:url}','${2:ControllerName}::${3:index}');$0"],
|
||||
"description": "CodeIgniter 4 - Make Routes add()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_CLI": {
|
||||
"prefix": "ci4:routes:cli",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->cli('${1:migrate}','${2:App\\\\Database}::${3:migrate}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Command-Line only Routes"
|
||||
},
|
||||
"Codeigniter4_ROUTES_ENVIRONMENT": {
|
||||
"prefix": "ci4:routes:env",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->environment('${1:development}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->add('${2:builder}','${3:Tools\\\\Builder}::${4:index}');",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Environment"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GET": {
|
||||
"prefix": "ci4:routes:get",
|
||||
"lang": ["php"],
|
||||
"body": ["\\$routes->get('${1:url}','${2:ControllerName}::${3:index}');$0"],
|
||||
"description": "CodeIgniter 4 - Make Routes get()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP": {
|
||||
"prefix": "ci4:routes:group",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:admin}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->add('${2:url}','${3:ControllerName}::${4:index};')",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_FILTER": {
|
||||
"prefix": "ci4:routes:group-filter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:api}',['filter' => '${2:api-auth}'], function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->resource('${3:url}');",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() filter"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_MULTIPLE": {
|
||||
"prefix": "ci4:routes:group-multiple",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:admin}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->group('${2:users}', function(\\$routes)",
|
||||
"\t{",
|
||||
"\t\t\\${3:// Route}",
|
||||
"\t});",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() multiple"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_NAMESPACE": {
|
||||
"prefix": "ci4:routes:group-namespace",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:api}',['namespace' => '${2:App\\\\API\\\\v1}'], function(\\$routes)",
|
||||
"{",
|
||||
"\t\\${3://Route}",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() namespace"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PLACEHOLDER": {
|
||||
"prefix": "ci4:routes:placeholder",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->${1|add,get,post,put,delete|}('${2:url}/(:${3|any,segment,num,alpha,alphanum,hash|})','${4:ControllerName}::${5:index}/\\$1');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Placeholder (:any) (:segment) (:num) (:alpha) (:alphanum) (:hash)"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PLACEHOLDER_CUSTOM": {
|
||||
"prefix": "ci4:routes:placeholder:custom",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->addPlaceholder('${1:uuid}', '${2:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}');",
|
||||
"\\$routes->${3|add,get,post,put,delete|}('${4:url}/(:${1:uuid})','${5:ControllerName}::${6:index}/\\$1');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Custom Placeholder default (:uuid)"
|
||||
},
|
||||
"Codeigniter4_ROUTES_POST": {
|
||||
"prefix": "ci4:routes:post",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->post('${1:url}','${2:ControllerName}::${3:index}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes post()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PRESENTER": {
|
||||
"prefix": "ci4:routes:presenter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->presenter('${1:url}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes presenter()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_RESOURCE": {
|
||||
"prefix": "ci4:routes:resource",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->resource('${1:url}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes resource()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_SUBDOMAIN": {
|
||||
"prefix": "ci4:routes:subdomain",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->add('${1:from}', '${2:to}', ['subdomain' => '${2:*}']);$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Limit to Subdomains"
|
||||
}
|
||||
{
|
||||
"Codeigniter4_ROUTES_ADD": {
|
||||
"prefix": "ci4:routes:add",
|
||||
"lang": ["php"],
|
||||
"body": ["\\$routes->add('${1:url}','${2:ControllerName}::${3:index}');$0"],
|
||||
"description": "CodeIgniter 4 - Make Routes add()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_CLI": {
|
||||
"prefix": "ci4:routes:cli",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->cli('${1:migrate}','${2:App\\\\Database}::${3:migrate}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Command-Line only Routes"
|
||||
},
|
||||
"Codeigniter4_ROUTES_ENVIRONMENT": {
|
||||
"prefix": "ci4:routes:env",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->environment('${1:development}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->add('${2:builder}','${3:Tools\\\\Builder}::${4:index}');",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Environment"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GET": {
|
||||
"prefix": "ci4:routes:get",
|
||||
"lang": ["php"],
|
||||
"body": ["\\$routes->get('${1:url}','${2:ControllerName}::${3:index}');$0"],
|
||||
"description": "CodeIgniter 4 - Make Routes get()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP": {
|
||||
"prefix": "ci4:routes:group",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:admin}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->add('${2:url}','${3:ControllerName}::${4:index};')",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_FILTER": {
|
||||
"prefix": "ci4:routes:group-filter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:api}',['filter' => '${2:api-auth}'], function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->resource('${3:url}');",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() filter"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_MULTIPLE": {
|
||||
"prefix": "ci4:routes:group-multiple",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:admin}', function(\\$routes)",
|
||||
"{",
|
||||
"\t\\$routes->group('${2:users}', function(\\$routes)",
|
||||
"\t{",
|
||||
"\t\t\\${3:// Route}",
|
||||
"\t});",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() multiple"
|
||||
},
|
||||
"Codeigniter4_ROUTES_GROUP_NAMESPACE": {
|
||||
"prefix": "ci4:routes:group-namespace",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->group('${1:api}',['namespace' => '${2:App\\\\API\\\\v1}'], function(\\$routes)",
|
||||
"{",
|
||||
"\t\\${3://Route}",
|
||||
"});$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes group() namespace"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PLACEHOLDER": {
|
||||
"prefix": "ci4:routes:placeholder",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->${1|add,get,post,put,delete|}('${2:url}/(:${3|any,segment,num,alpha,alphanum,hash|})','${4:ControllerName}::${5:index}/\\$1');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Placeholder (:any) (:segment) (:num) (:alpha) (:alphanum) (:hash)"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PLACEHOLDER_CUSTOM": {
|
||||
"prefix": "ci4:routes:placeholder:custom",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->addPlaceholder('${1:uuid}', '${2:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}');",
|
||||
"\\$routes->${3|add,get,post,put,delete|}('${4:url}/(:${1:uuid})','${5:ControllerName}::${6:index}/\\$1');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Custom Placeholder default (:uuid)"
|
||||
},
|
||||
"Codeigniter4_ROUTES_POST": {
|
||||
"prefix": "ci4:routes:post",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->post('${1:url}','${2:ControllerName}::${3:index}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes post()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_PRESENTER": {
|
||||
"prefix": "ci4:routes:presenter",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->presenter('${1:url}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes presenter()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_RESOURCE": {
|
||||
"prefix": "ci4:routes:resource",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->resource('${1:url}');$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes resource()"
|
||||
},
|
||||
"Codeigniter4_ROUTES_SUBDOMAIN": {
|
||||
"prefix": "ci4:routes:subdomain",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$routes->add('${1:from}', '${2:to}', ['subdomain' => '${2:*}']);$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Routes Limit to Subdomains"
|
||||
}
|
||||
}
|
|
@ -1,23 +1,23 @@
|
|||
{
|
||||
"Codeigniter4_Validation_Controller": {
|
||||
"prefix": "ci4:validation:controller",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$validation = \\\\Config\\\\Services::validation();",
|
||||
"\\$rules = [",
|
||||
"\t 'field_1' => [",
|
||||
"\t\t'label'\t=> 'Field 1 Custom Name',",
|
||||
"\t\t'rules'\t=> 'required',",
|
||||
"\t\t'errors'\t=> [",
|
||||
"\t\t\t'required'\t=> '{field} is required.'",
|
||||
"\t\t]",
|
||||
"\t],",
|
||||
"];",
|
||||
"if (!\\$this->validate(\\$rules)) {",
|
||||
"\treturn redirect()->to('${1:route}')->withInput()->with('validation', \\$validation);",
|
||||
"}",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Validation in Controller"
|
||||
}
|
||||
{
|
||||
"Codeigniter4_Validation_Controller": {
|
||||
"prefix": "ci4:validation:controller",
|
||||
"lang": ["php"],
|
||||
"body": [
|
||||
"\\$validation = \\\\Config\\\\Services::validation();",
|
||||
"\\$rules = [",
|
||||
"\t 'field_1' => [",
|
||||
"\t\t'label'\t=> 'Field 1 Custom Name',",
|
||||
"\t\t'rules'\t=> 'required',",
|
||||
"\t\t'errors'\t=> [",
|
||||
"\t\t\t'required'\t=> '{field} is required.'",
|
||||
"\t\t]",
|
||||
"\t],",
|
||||
"];",
|
||||
"if (!\\$this->validate(\\$rules)) {",
|
||||
"\treturn redirect()->to('${1:route}')->withInput()->with('validation', \\$validation);",
|
||||
"}",
|
||||
"$0"
|
||||
],
|
||||
"description": "CodeIgniter 4 - Make Validation in Controller"
|
||||
}
|
||||
}
|
|
@ -1,80 +1,80 @@
|
|||
{
|
||||
"name": "font-awesome-5-codes-html",
|
||||
"displayName": "Font awesome 5 HTML snippets",
|
||||
"description": "Font awesome 5 HTML snippets",
|
||||
"icon": "fontawesome_128px.png",
|
||||
"version": "1.0.1",
|
||||
"publisher": "mrdemonwolf",
|
||||
"license": "See License section in README.md",
|
||||
"homepage": "https://github.com/MrDemonWolf/font-awesome-5-codes-html/blob/master/README.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/MrDemonWolf/font-awesome-5-codes-html.git"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^0.10.1"
|
||||
},
|
||||
"galleryBanner": {
|
||||
"color": "#E6E0EA",
|
||||
"theme": "light"
|
||||
},
|
||||
"categories": [
|
||||
"Snippets"
|
||||
],
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": "blade",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "ejs",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "html",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "handlebars",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "latte",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "plaintext",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "razor",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "tpl",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "typescript",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "typescriptreact",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "twig",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "vue",
|
||||
"path": "./snippets.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"name": "font-awesome-5-codes-html",
|
||||
"displayName": "Font awesome 5 HTML snippets",
|
||||
"description": "Font awesome 5 HTML snippets",
|
||||
"icon": "fontawesome_128px.png",
|
||||
"version": "1.0.1",
|
||||
"publisher": "mrdemonwolf",
|
||||
"license": "See License section in README.md",
|
||||
"homepage": "https://github.com/MrDemonWolf/font-awesome-5-codes-html/blob/master/README.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/MrDemonWolf/font-awesome-5-codes-html.git"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^0.10.1"
|
||||
},
|
||||
"galleryBanner": {
|
||||
"color": "#E6E0EA",
|
||||
"theme": "light"
|
||||
},
|
||||
"categories": [
|
||||
"Snippets"
|
||||
],
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": "blade",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "ejs",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "html",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "handlebars",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "latte",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "php",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "plaintext",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "razor",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "tpl",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "typescript",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "typescriptreact",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "twig",
|
||||
"path": "./snippets.json"
|
||||
},
|
||||
{
|
||||
"language": "vue",
|
||||
"path": "./snippets.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|