nvim/UltiSnips/php.snippets

96 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

2021-10-25 08:35:01 +00:00
extends html
2022-03-13 19:42:13 +00:00
snippet doc "/**"
/**
* $1
*/$0
endsnippet
2022-02-06 10:28:49 +00:00
snippet pre "<pre>print_r()</pre>"
echo "<pre>";
print_r($0);
echo "</pre>";
endsnippet
2021-10-07 10:56:31 +00:00
snippet if "if () {}"
if ($1) {
$0
}
endsnippet
snippet fe "foreach () {}"
foreach (\$${1:array} as \$${2:item}) {
$0
}
endsnippet
snippet pp "<?php ... ?>"
<?php $0; ?>
endsnippet
snippet pe "<?php ... ?>"
<?php echo "$0"; ?>
endsnippet
snippet ph "<?php ... ?>"
<?php esc_html( $0 ); ?>
endsnippet
2020-03-19 15:47:31 +00:00
snippet pf "public function ..."
public function $1($2) {
2020-05-10 13:15:31 +00:00
$0
2020-03-19 15:47:31 +00:00
}
endsnippet
2020-05-10 13:15:31 +00:00
2022-03-13 19:42:13 +00:00
snippet pt "protected function ..."
protected function $1($2) {
$0
}
endsnippet
snippet pv "private function ..."
private function $1($2) {
$0
}
endsnippet
2021-10-05 17:57:52 +00:00
snippet psf "public static function ..."
public static function $1($2) {
$0
}
endsnippet
2020-05-10 21:23:19 +00:00
2021-10-05 17:57:52 +00:00
snippet prsf "public static function ..."
private static function $1($2) {
$0
2020-05-10 13:15:31 +00:00
}
2021-10-05 17:57:52 +00:00
endsnippet
snippet ''= "'...' => "
'$1' => $0,
2020-05-10 13:15:31 +00:00
endsnippet
2021-10-07 10:56:31 +00:00
snippet apm "add_post_meta(..."
2022-09-20 17:46:49 +00:00
add_post_meta( ${1:2720}, '__DEBUG__$2', $0);
2021-10-07 10:56:31 +00:00
endsnippet
snippet upm "update_post_meta(..."
2022-09-20 17:46:49 +00:00
update_post_meta( ${1:2720}, '__DEBUG__$1', $0);
2022-03-13 19:42:13 +00:00
endsnippet
snippet sw "switch ..."
switch ($1) {
case $2:
$3;
break;
default:
$0
}
endsnippet
snippet cs "case ..."
case $1:
$0;
break;
2021-10-07 10:56:31 +00:00
endsnippet