2013-07-31 09:56:59 -04:00
|
|
|
snippet <? "php open tag" b
|
|
|
|
<?php
|
2013-03-17 15:13:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
endsnippet
|
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
snippet vdd "php var_dump and die" b
|
|
|
|
var_dump(); die();
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
snippet ns "php namespace" b
|
|
|
|
namespace ${1:`!p
|
|
|
|
abspath = os.path.abspath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', abspath)
|
|
|
|
if m:
|
|
|
|
snip.rv = m.group().replace('/', '\\')
|
|
|
|
`};
|
2013-03-17 15:13:47 -04:00
|
|
|
endsnippet
|
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
snippet nc "php namespace and class" b
|
|
|
|
namespace ${1:`!p
|
|
|
|
abspath = os.path.abspath(path)
|
|
|
|
m = re.search(r'[A-Z].+(?=/)', abspath)
|
|
|
|
if m:
|
|
|
|
snip.rv = m.group().replace('/', '\\')
|
|
|
|
`};
|
2013-03-17 15:13:47 -04:00
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
/**
|
|
|
|
* ${3:@author `whoami`}$4
|
2013-03-17 15:13:47 -04:00
|
|
|
*/
|
2013-07-31 09:56:59 -04:00
|
|
|
class ${2:`!p
|
|
|
|
snip.rv = re.match(r'.*(?=\.)', fn).group().capitalize()
|
|
|
|
`}
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
snippet st "php static function" b
|
|
|
|
${1:public} static function $2($3)
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2013-07-31 09:56:59 -04:00
|
|
|
${4}
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
snippet __ "php constructor" b
|
|
|
|
${1:public} function __construct($2)
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2013-07-31 09:56:59 -04:00
|
|
|
${3}
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
|
|
|
endsnippet
|
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
snippet sg "Setter and Getter" b
|
2013-03-17 15:13:47 -04:00
|
|
|
|
|
|
|
/**
|
2013-07-31 09:56:59 -04:00
|
|
|
* @var ${3:`!p snip.rv = t[2].capitalize()`}${4}
|
2013-03-17 15:13:47 -04:00
|
|
|
*/
|
2013-07-31 09:56:59 -04:00
|
|
|
${1:protected} $$2;
|
|
|
|
|
|
|
|
public function set`!p snip.rv = t[2].capitalize()`(`!p
|
|
|
|
if re.match(r'[A-Z].*', t[3]):
|
|
|
|
snip.rv = t[3] + ' '
|
|
|
|
else:
|
|
|
|
snip.rv = ''
|
|
|
|
`$$2)
|
2013-03-17 15:13:47 -04:00
|
|
|
{
|
2013-07-31 09:56:59 -04:00
|
|
|
$this->$2 = $$2;
|
2013-03-17 15:13:47 -04:00
|
|
|
|
2013-07-31 09:56:59 -04:00
|
|
|
return $this;
|
2013-03-17 15:13:47 -04:00
|
|
|
}
|
|
|
|
endsnippet
|