neosnippet.vim/neosnippets/php.snip

277 lines
3.6 KiB
Plaintext
Raw Normal View History

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