added a few inline snippets for templating

This commit is contained in:
George Lee 2012-04-07 20:33:16 +08:00
parent 009bd3ad8d
commit 50c68ed00a

View File

@ -170,6 +170,10 @@ snippet if
if (${1:/* condition */}) { if (${1:/* condition */}) {
${2:// code...} ${2:// code...}
} }
snippet ifil
<?php if (${1:/* condition */}): ?>
${2:<!-- code... -->}
<?php endif; ?>
snippet ife snippet ife
if (${1:/* condition */}) { if (${1:/* condition */}) {
${2:// code...} ${2:// code...}
@ -177,6 +181,13 @@ snippet ife
${3:// code...} ${3:// code...}
} }
${4} ${4}
snippet ifeil
<?php if (${1:/* condition */}): ?>
${2:<!-- html... -->}
<?php else: ?>
${3:<!-- html... -->}
<?php endif; ?>
${4}
snippet else snippet else
else { else {
${1:// code...} ${1:// code...}
@ -210,10 +221,18 @@ snippet foreach
foreach ($${1:variable} as $${2:value}) { foreach ($${1:variable} as $${2:value}) {
${3:// code...} ${3:// code...}
} }
snippet foreachil
<?php foreach ($${1:variable} as $${2:value}): ?>
${3:<!-- html... -->}
<?php endforeach; ?>
snippet foreachk snippet foreachk
foreach ($${1:variable} as $${2:key} => $${3:value}) { foreach ($${1:variable} as $${2:key} => $${3:value}) {
${4:// code...} ${4:// code...}
} }
snippet foreachkil
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
${4:<!-- html... -->}
<?php endforeach; ?>
snippet fun snippet fun
${1:public }function ${2:FunctionName}(${3}) ${1:public }function ${2:FunctionName}(${3})
{ {