VSCode - PHP Snippets สำหรับฉัน

{
    // 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"
    // }
    "ci - query": {
        "prefix": "db-query",
        "body": [
            "\\$this->db->query(\"SELECT * FROM ${1:tbname}\")->${2:result_array();}${3:row_array();}",
        ],
        "description": "CI - Query"
    },
    "php": {
        "prefix": "<?php",
        "body": [
            "<?php echo ${1:variable} ?>;",
        ],
        "description": "Open/Close PHP - <?php echo ... ?>"
    },
    "pre block print_r": {
        "prefix": "prev",
        "body": [
            "echo '<pre>';",
            "print_r(${1:\\$_POST});",
            "echo '</pre>';",
            "exit();"
        ],
        "description": "PHP: Pre block print_r"
    },
    "php-input": {
        "prefix": "php-input",
        "body": [
            "\\$_POST = json_decode(file_get_contents(\"php:\//input\"),TRUE);"
        ],
        "description": "PHP :: php://input"
    },
    "generate code": {
        "prefix": "gen_index",
        "body": [
            "_genNoIndex('${1:prefixed}', ${2:number});"
        ],
        "description": "General Helper - $prefixed . sprintf('%04d', $number)"
    },
    "ckeditor_url": {
        "prefix": "ckeditor_url",
        "body": [
            "ckeditor_url('${1:element}', ${2:1});",
        ],
        "description": "General Helper - ckeditor_url($element = '', $quantity = 1)"
    },
    "ckeditor_advanced_url": {
        "prefix": "ckeditor_advanced_url",
        "body": [
            "ckeditor_advanced_url('${1:element}', ${2:1});",
        ],
        "description": "General Helper - ckeditor_advanced_url($element = '', $quantity = 1)"
    },
    "strip html tags": {
        "prefix": "strip_tags",
        "body": [
            "strip_tags('${1:text}'"
        ],
        "description": "General Helper - strip_tags('text...')"
    },
    "date now": {
        "prefix": "NOW",
        "body": [
            "NOW();"
        ],
        "description": "Date Helper - NOW()"
    },
    "current data": {
        "prefix": "CURDATE",
        "body": [
            "CURDATE();"
        ],
        "description": "Date Helper - CURDATE()"
    },
    "site_url": {
        "prefix": "site_url",
        "body": [
            "site_${1:admin|user}_url('${2:url}');",
        ],
        "description": "URL Helper - site_url({APP_BACKEND | APP_FRONTEND} . '/' . $uri)"
    },
    "site_controller_url": {
        "prefix": "site_controller_url",
        "body": [
            "site_${1:admin|user}_controller_url('${2:url}');",
        ],
        "description": "URL Helper - site_admin_controller_url({APP_BACKEND | APP_FRONTEND} . '/' . $uri)"
    },
    "site_module_url": {
        "prefix": "site_module_url",
        "body": [
            "site_${1:admin|user}_module_url('${2:url}');",
        ],
        "description": "URL Helper - site_module_url({APP_BACKEND | APP_FRONTEND} . '/' . $uri)"
    },
    "site_asset_url": {
        "prefix": "site_asset_url",
        "body": [
            "site_asset_${1:frontend|backend}_url('${2:url}');",
        ],
        "description": "URL Helper - site_url('assets/{frontend|backend}/' . $url)"
    },
    "site_asset_modules_url": {
        "prefix": "site_asset_modules_url",
        "body": [
            "site_asset_${1:frontend|backend}_modules_url('${2:url}');",
        ],
        "description": "URL Helper - site_url('assets/{frontend|backend}/node_modules/' . $url)"
    },
    "site_asset_common_img_url": {
        "prefix": "site_asset_common_img_url",
        "body": [
            "site_asset_common_img_url('${1:url}');",
        ],
        "description": "URL Helper - site_url('assets/common/images/' . $url)"
    },
    "site_common_url": {
        "prefix": "site_common_url",
        "body": [
            "site_common_url('${1:url}');",
        ],
        "description": "URL Helper - site_url('assets/common/' . $url)"
    },
    "site_common_node_modules_url": {
        "prefix": "site_common_node_modules_url",
        "body": [
            "site_common_node_modules_url('${1:url}');",
        ],
        "description": "URL Helper - site_url('assets/common/node_modules/' . $url)"
    },
    "site_uploads_url": {
        "prefix": "site_uploads_url",
        "body": [
            "site_uploads_url('${1:folder}', '${2:url}');",
        ],
        "description": "URL Helper - site_url('uploads/$folder/' . $url);"
    },
    "site_wpsize_url": {
        "prefix": "site_wpsize_url",
        "body": [
            "site_wpsize_url('${1:url}');",
        ],
        "description": "URL Helper - site_wpsize_url(url)"
    },
    "site_wpsize_subfolder_url": {
        "prefix": "site_wpsize_subfolder_url",
        "body": [
            "site_wpsize_subfolder_url('${1:url}');",
        ],
        "description": "URL Helper - site_wpsize_subfolder_url(url)"
    },
    "gen_folder": {
        "prefix": "gen_folder",
        "body": [
            "gen_folder('${1:url}');",
        ],
        "description": "URL Helper - gen_folder(url)"
    },
    "_file_exists": {
        "prefix": "_file_exists",
        "body": [
            "_file_exists('${1:url}');",
        ],
        "description": "URL Helper - _file_exists(url)"
    },
    "_file_exists_subfolder": {
        "prefix": "_file_exists_subfolder",
        "body": [
            "_file_exists_subfolder('${1:url}');",
        ],
        "description": "URL Helper - _file_exists_subfolder(url)"
    },
    "site_string_url": {
        "prefix": "site_string_url",
        "body": [
            "site_string_url('${1:url}');",
        ],
        "description": "URL Helper - site_string_url(url)"
    },
    "site_refresh_url": {
        "prefix": "site_refresh_url",
        "body": [
            "site_refresh_url('${1:url}');",
        ],
        "description": "URL Helper - site_refresh_url(url)"
    },
}
 

จัดทำโปรแกรมคอมพิวเตอร์พัฒนาระบบงานธุรกิจส่วนตัวและหน่วยงาน

086-2887-987 (ท็อป)

Nakomah Studio   itopcybersoft@gmail.com

TOP