1
0
Fork 0
mirror of synced 2024-12-25 00:03:20 -05:00
ultimate-vim/sources_non_forked/vim-snippets/phtml.snippets
2012-08-16 23:41:25 -04:00

74 lines
1.4 KiB
Text

snippet ec "PHTML echo"
<?php echo ${1:$var} ?>${2}
endsnippet
snippet inc "PHTML include"
<?php include '${1:file}' ?>${2}
endsnippet
snippet inc1 "PHTML include_once"
<?php include_once '${1:file}' ?>${2}
endsnippet
snippet req "PHTML require"
<?php require '${1:file}' ?>${2}
endsnippet
snippet req1 "PHTML require_once"
<?php require_once '${1:file}' ?>${2}
endsnippet
snippet if "PHTML if"
<?php if (${1:/* condition */}): ?>
${2:// code...}
<?php endif ?>
endsnippet
snippet ife "PHTML if else"
<?php if (${1:/* condition */}): ?>
${2:// code...}
<?php else: ?>
${3:// code...}
<?php endif ?>
${4}
endsnippet
snippet el "PHTML else"
<?php else: ?>
endsnippet
snippet elf "PHTML elseif"
<?php elseif (${1:/* condition */}): ?>
${2:// code...}
endsnippet
snippet wh "PHTML while"
<?php while (${1:/* condition */}): ?>
${2:// code...}
<?php endwhile ?>
endsnippet
snippet do "PHTML do"
<?php do: ?>
${2:// code... }
<?php while (${1:/* condition */}) ?>
endsnippet
snippet for "PHTML for"
<?php for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}): ?>
${4: // code...}
<?php endfor ?>
endsnippet
snippet foreach "PHTML foreach"
<?php foreach ($${1:variable} as $${2:value}): ?>
${3:// code...}
<?php endforeach ?>
endsnippet
snippet foreachk "PHTML foreach $key => $value"
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
${4:// code...}
<?php endforeach ?>
endsnippet