Last active
December 19, 2015 09:49
-
-
Save jimmylatreille/5935625 to your computer and use it in GitHub Desktop.
Snippet pour les class PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
class ${1:className} { | |
//variable instance | |
private \$${2:val}; | |
//constructeur | |
function __construct(\$${2:val}){ | |
\$this->${2:val} = \$${2:val}; | |
} //fin constructeur ${1:className} | |
//Getter ${2:val}() | |
public function get${2/(?:^|_)(\w)/\U$1$2/g$1}(){ | |
return \$this->${2:val}; | |
} | |
//Setter ${2:val}() | |
public function set${2/(?:^|_)(\w)/\U$1$2/g$1}(\$${2:val}){ | |
\$this->${2:val} = \$${2:val}; | |
} | |
} // fin de la class ${1:className} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>pclass</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment