Merge pull request #282 from chrisyue/master
[php] [symfony] some bugfix and improve
This commit is contained in:
commit
665d9d39c3
@ -62,14 +62,15 @@ ${1:public} function __construct($2)
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet sg "Setter and Getter" b
|
snippet sg "Setter and Getter" b
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ${3:`!p snip.rv = t[2].capitalize()`}
|
* @var ${3:`!p snip.rv = t[2][0:1].upper() + t[2][1:]`}
|
||||||
|
*
|
||||||
|
* ${4}
|
||||||
*/
|
*/
|
||||||
${1:protected} $$2;
|
${1:protected} $${2};
|
||||||
|
|
||||||
public function set`!p snip.rv = t[2].capitalize()`(`!p
|
public function set`!p snip.rv = t[2][0:1].upper() + t[2][1:]`(`!p
|
||||||
if re.match(r'[A-Z].*', t[3]):
|
if re.match(r'^(\\|[A-Z]).*', t[3]):
|
||||||
snip.rv = t[3] + ' '
|
snip.rv = t[3] + ' '
|
||||||
else:
|
else:
|
||||||
snip.rv = ''
|
snip.rv = ''
|
||||||
@ -80,7 +81,7 @@ else:
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get`!p snip.rv = t[2].capitalize()`()
|
public function get`!p snip.rv = t[2][0:1].upper() + t[2][1:]`()
|
||||||
{
|
{
|
||||||
return $this->$2;
|
return $this->$2;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ snippet act "symfony2 action" b
|
|||||||
public function ${1}Action(${2})
|
public function ${1}Action(${2})
|
||||||
{
|
{
|
||||||
${6}
|
${6}
|
||||||
return $this->redirect($this->generate('home', [], false));
|
return $this->redirect($this->generateUrl('home', [], false));
|
||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
@ -175,7 +175,11 @@ tmp = re.sub(r'\B([A-Z])', r'_\1', tmp)
|
|||||||
snip.rv = tmp.lower()
|
snip.rv = tmp.lower()
|
||||||
`")
|
`")
|
||||||
*/
|
*/
|
||||||
class `!p
|
`!p
|
||||||
|
m = re.search(r'Abstract', path)
|
||||||
|
if m:
|
||||||
|
snip.rv = 'abstract '
|
||||||
|
`class `!p
|
||||||
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
snip.rv = re.match(r'.*(?=\.)', fn).group()
|
||||||
`
|
`
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user