Add custom php snippets to use as an example
parent
8b13316a50
commit
da6bd518bc
@ -0,0 +1,41 @@
|
||||
snippet php "Starting php tag" !b
|
||||
<?php
|
||||
endsnippet
|
||||
|
||||
snippet phpil "php inline tag" !b
|
||||
<?php ${1} ?>
|
||||
endsnippet
|
||||
|
||||
snippet ec "echo" !b
|
||||
echo "${1}";
|
||||
endsnippet
|
||||
|
||||
snippet f "Anonymous function"
|
||||
function () {
|
||||
${1}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet fuse "Anonymous function with use"
|
||||
function () use (${1}) {
|
||||
${2}
|
||||
}
|
||||
endsnippet
|
||||
|
||||
snippet this "this helper"
|
||||
$${1:this}->${2:prop}
|
||||
endsnippet
|
||||
|
||||
snippet [] "array literal"
|
||||
array(${1})
|
||||
endsnippet
|
||||
|
||||
snippet {} "Empty object"
|
||||
new stdClass()
|
||||
endsnippet
|
||||
|
||||
snippet scf "self calling function" !b
|
||||
call_user_func(function () {
|
||||
${1}
|
||||
});
|
||||
endsnippet
|
Loading…
Reference in New Issue