From a6a10c815017c9357f02e3deae0a8e44f8004838 Mon Sep 17 00:00:00 2001 From: chrisyue Date: Mon, 30 Jul 2012 23:09:36 +0800 Subject: [PATCH] new ternary snippet --- snippets/php.snippets | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/snippets/php.snippets b/snippets/php.snippets index d6d6bae..9ce93d4 100644 --- a/snippets/php.snippets +++ b/snippets/php.snippets @@ -25,7 +25,7 @@ snippet i { ${2} } -snippet $t +snippet t. $this->${1} snippet f function ${1:foo}(${2:array }${3:$bar}) @@ -62,6 +62,13 @@ snippet $s #getter snippet $g ${1:$foo}->get${2:Bar}(); + +# Tertiary conditional +snippet =?: + $${1:foo} = ${2:true} ? ${3:a} : ${4}; +snippet ?: + ${1:true} ? ${2:a} : ${3} + snippet C $_COOKIE['${1:variable}']${2} snippet E @@ -253,9 +260,6 @@ snippet elseif elseif (${1:/* condition */}) { ${2:// code...} } -# Tertiary conditional -snippet t - $${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b};${5} snippet switch switch ($${1:variable}) { case '${2:value}':