วิธีการสร้าง โดยเลือก File->Preferences->User Snipets เลือก Html.json
แล้วเขียน code ดังนี้
"BlankSpace": {
"prefix": "blk",
"body": [
" "
],
"description": "Html blank code"
},
"BlankSpace+": {
"prefix": "blk+",
"body": [
"<?= str_repeat(' ', 5);?>"
],
"description": "Html blank code plus"
},
"MySQLi+": {
"prefix": "mysqli",
"body": [
"///////////////*connection */",
"$link = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname);",
"if (mysqli_connect_errno()) { /* check connection */",
" printf('Connect failed: %s', mysqli_connect_error());",
" exit();",
"}",
"mysqli_query($link,'set NAMES utf8');",
"/////////////////////",
"$query = 'SELECT * FROM Mytable';",
"$result = mysqli_query($link, $query);",
"while ($row = mysqli_fetch_assoc($result)) {",
" $row['cdate']",
" $row['systolic']",
"}",
"mysqli_free_result($result);",
],
"description": "MySQLi Command Set"
},
หมายเหตุคำอธิบายที่สำคัญ :
prefix = ค่าของตัวเรียกใช้
body = ค่าเนื้อหาของ snippet
ไม่มีความคิดเห็น:
แสดงความคิดเห็น