new ternary snippet

This commit is contained in:
chrisyue 2012-07-30 23:09:36 +08:00
parent faa4bb490e
commit a6a10c8150

View File

@ -25,7 +25,7 @@ snippet i
{ {
${2} ${2}
} }
snippet $t snippet t.
$this->${1} $this->${1}
snippet f snippet f
function ${1:foo}(${2:array }${3:$bar}) function ${1:foo}(${2:array }${3:$bar})
@ -62,6 +62,13 @@ snippet $s
#getter #getter
snippet $g snippet $g
${1:$foo}->get${2:Bar}(); ${1:$foo}->get${2:Bar}();
# Tertiary conditional
snippet =?:
$${1:foo} = ${2:true} ? ${3:a} : ${4};
snippet ?:
${1:true} ? ${2:a} : ${3}
snippet C snippet C
$_COOKIE['${1:variable}']${2} $_COOKIE['${1:variable}']${2}
snippet E snippet E
@ -253,9 +260,6 @@ snippet elseif
elseif (${1:/* condition */}) { elseif (${1:/* condition */}) {
${2:// code...} ${2:// code...}
} }
# Tertiary conditional
snippet t
$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5}
snippet switch snippet switch
switch ($${1:variable}) { switch ($${1:variable}) {
case '${2:value}': case '${2:value}':