neosnippet.vim/autoload/neosnippet/snippets/php.snip
2012-09-30 17:04:46 +09:00

261 lines
3.3 KiB
Plaintext

snippet function
abbr function () {}
${1:public }function ${2:FunctionName}(${3})
{
${4:// code...}
}
snippet php
<?php
${1}
?>
snippet pecho
<?php echo ${1} ?>${0}
snippet echoh
<?php echo htmlentities(${1}, ENT_QUOTES, 'utf-8') ?>${0}
snippet pfore
<?$php foreach ($${1:variable} as $${2:key}${3: =>}): ?>
${0}
<?php endforeach ?>
snippet pife
<?php if (${1:condition}): ?>
${2}
<?php else: ?>
${0}
<?php endif ?>
snippet pif
<?php if (${1:condition}): ?>
${0}
<?php endif ?>
snippet pelse
<?php else: ?>
snippet this
<?php $this->${0} ?>
snippet ethis
<?php echo $this->${0} ?>
snippet docc
/**
* ${3:undocumented class variable}
*
* @var ${4:string}
**/
${1:var} $${2};${0}
snippet docd
/**
* ${3:undocumented constant}
**/
define(${1} ${2});${0}
snippet docs
/**
* ${4:undocumented function}
*
* @return ${5:void}
* @author ${6}
**/
${1}function ${2}(${3});${0}
snippet docf
/**
* ${4:undocumented function}
*
* @return ${5:void}
* @author ${6}
**/
${1}function ${2}(${3})
{
${0}
}
snippet doch
/**
* ${1}
*
* @author ${2}
* @version ${3}
* @copyright ${4}
* @package ${5:default}
**/
/**
* Define DocBlock
**/
snippet doci
/**
* ${2:undocumented class}
*
* @package ${3:default}
* @author ${4}
**/
interface ${1}
{
${0}
} // END interface ${1}
snippet c
/**
* $0
*/
snippet class
/**
* ${1}
*/
class ${2:ClassName}${3:extends}}
{
$5
function ${4:__construct}(${5:argument})
{
${0:# code...}
}
}
snippet def
${1}defined('${2}')${0}
snippet do
do {
${0:# code...}
} while (${1});
snippet if?
$${1:retVal} = (${2:condition}) ? ${3:a} : ${4:b} ;
snippet ifelse
if (${1:condition}) {
${2:# code...}
} else {
${3:# code...}
}
${0}
snippet if
if (${1:condition}) {
${0:# code...}
}
snippet echo
echo "${1:string}"${0};
snippet else
else {
${0:# code...}
}
snippet elseif
elseif (${1:condition}) {
${0:# code...}
}
snippet for
for ($${1:i}=${2:0}; $${1:i} < ${3}; $${1:i}++) {
${0:# code...}
}
snippet fore
foreach ($${1:variable} as $${2:key}${3: =>} $${4:value}) {
${0:# code...}
}
snippet con
function __construct(${1})
{
${0}
}
snippet here
<<<${1:HTML}
${2:content here}
$1;
snippet inc
include '${1:file}';${0}
snippet inco
include_once '${1:file}';${0}
snippet array
$${1:arrayName} = array('${2}' => ${3} ${0});
snippet req
require '${1:file}';${0}
snippet reqo
require_once '${1:file}';${0}
snippet ret
return${1};${0}
snippet retf
return false;
snippet rett
return true;
snippet case
case '${1:variable}':
${0:# code...}
break;
snippet switch
abbr sw
switch (${1:variable}) {
case '${2:value}':
${3:# code...}
break;
${0}
default:
${4:# code...}
break;
}
snippet throw
throw new ${1}Exception(${2:"${3:Error Processing Request}"}${4:});
${0}
snippet while
abbr wh
while (${1}) {
${0:# code...}
}
snippet gloabals
\$GLOBALS['${1:variable}']${2: = }${3:something}${4:;}${0}
snippet cookie
\$_COOKIE['${1:variable}']
snippet env
\$_ENV['${1:variable}']
snippet files
\$_FILES['${1:variable}']
snippet get
\$_GET['${1:variable}']
snippet post
\$_POST['${1:variable}']
snippet request
\$_REQUEST['${1:variable}']
snippet server
\$_SERVER['${1:variable}']
snippet session
\$_SESSION['${1:variable}']