Skip to content

Instantly share code, notes, and snippets.

@gaibz
Created February 7, 2020 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaibz/a50d9ac6017b01baff9b79da7879f647 to your computer and use it in GitHub Desktop.
Save gaibz/a50d9ac6017b01baff9b79da7879f647 to your computer and use it in GitHub Desktop.
VSC PHP Snippet from mac
{
// Place your snippets for php here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"CI3 Controller": {
"prefix": "ci3_controller",
"body": [
"defined(\"BASEPATH\") or die(\"ACCESS DENIED !\");",
"/**",
" * Class Summary",
" * ",
" * Class Description",
" * ",
" * @author Herlangga Sefani Wijaya",
" * @package Package_Name",
" * @subpackage Controller ",
" * @category Controller",
" */",
"class ${1:controller_name} extends CI_Controller{",
" function __construct(){",
" parent::__construct();",
" }",
"",
"}",
"",
"/* End of file application/controllers/${1:controller_name}.php */"
],
"description": "CI3 Controller"
},
"CI3 Model": {
"prefix": "ci3_model",
"body": [
"defined(\"BASEPATH\") or die(\"ACCESS DENIED !\");",
"/**",
" * Class Summary",
" * ",
" * Class Description",
" * ",
" * @author Herlangga Sefani Wijaya",
" * @package Package_Name",
" * @subpackage Model",
" * @category Model",
" */",
"class ${1:model_name} extends CI_Model{",
" function __construct(){",
" parent::__construct();",
" }",
"}",
"",
"/* End of file application/models/${1:model_name}.php */"
],
"description": "CI3 Model"
},
"PHP Function Declare": {
"prefix": "php_function_pro",
"body": [
"/**",
" * Function description",
" *",
" * @param",
" * @return",
" */",
"${1|public,private,protected|} function ${2:function_name}($3) {",
" $0",
"}"
],
"description": "PHP Function Declare"
}
"Simple PHP Function": {
"prefix": "php_function",
"body": [
"/**",
" * Function description",
" *",
" * @param",
" * @return",
" */",
"function ${1:function_name}(${2:args}) {",
" $0",
"}"
],
"description": "Simple PHP Function"
},
"PHP Interface Declare": {
"prefix": "php_interface",
"body": [
"/**",
" * Interface Description",
" * ",
" * @author Herlangga Sefani Wijaya",
" * @package Package",
" * @subpackage Interface ",
" * @category Interface",
" */",
"interface ${1:Interface_name}_Interface{",
"",
"}"
],
"description": "PHP Interface Declare"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment