Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP & code snippets #64

Open
xgqfrms opened this issue Dec 13, 2022 · 4 comments
Open

PHP & code snippets #64

xgqfrms opened this issue Dec 13, 2022 · 4 comments
Labels
global code snippets global code snippets

Comments

@xgqfrms
Copy link
Owner

xgqfrms commented Dec 13, 2022

PHP & code snippets

https://github.com/xgqfrms/vscode/blob/master/code-snippets/php.json

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 13, 2022

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 13, 2022

https://stackoverflow.com/questions/44321000/visual-studio-code-user-snippets-not-working

{
  "PHP 8 Template": {
    "scope": "php, html",
    "prefix": "p8t",
    "body": [
      "<?php",
      "",
      "/**",
      " * ",
      " * @author xgqfrms",
      " * @license MIT",
      " * @copyright xgqfrms",
      " * @created 2022-12-1$1",
      " * @modified ",
      " * ",
      " * @description $2",
      " * @link http://www.webhacker.com/$3.php",
      " * ",
      " */",
      "",
      "$args = $_GET[\"args\"];",
      "// $params = $_POST[\"params\"];",
      "// $all_in_one = $_REQUEST[\"args\"];",
      "echo \"<h1 style=\"color: red;\">red color: $args</h1>\";",
      "/*",
      "",
      "",
      "*/",
      "",
      "?>"
    ],
    "description": "PHP 8 Template & code snippets!"
  }
}

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 13, 2022

@xgqfrms
Copy link
Owner Author

xgqfrms commented Dec 13, 2022

global code snippets

~/Library/Application Support/Code/User/snippets/php.code-snippets

.code-snippets

image

{
	// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
	// is left empty or omitted, the snippet gets applied to all languages. 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": {
	// 	"scope": "javascript,typescript",
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }
}
{
  "PHP 8 Template": {
    "prefix": "p8t",
    "body": [
      "<?php",
      "",
      "/**",
      " * ",
      " * @author xgqfrms",
      " * @license MIT",
      " * @copyright xgqfrms",
      " * @created 2022-12-1$1",
      " * @modified ",
      " * ",
      " * @description $2",
      " * @link http://www.webhacker.com/$3.php",
      " * ",
      " */",
      "",
      "$args = $_GET[\"args\"];",
      "// $params = $_POST[\"params\"];",
      "// $all_in_one = $_REQUEST[\"args\"];",
      "echo \"<h1 style=\"color: red;\">red color: $args</h1>\";",
      "/*",
      "",
      "",
      "*/",
      "",
      "?>"
    ],
    "description": "PHP 8 Template & code snippets!"
  }
}

image

image

image

@xgqfrms xgqfrms added the global code snippets global code snippets label Dec 13, 2022
xgqfrms added a commit that referenced this issue Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
global code snippets global code snippets
Projects
None yet
Development

No branches or pull requests

1 participant