Skip to content

Instantly share code, notes, and snippets.

@jimmylatreille
Last active December 19, 2015 02:49
Show Gist options
  • Save jimmylatreille/5886144 to your computer and use it in GitHub Desktop.
Save jimmylatreille/5886144 to your computer and use it in GitHub Desktop.
Snippet getter setter PHP MVC sublime text 2
<snippet>
<content><![CDATA[
//Getter ${1:val}
public function get${1/(?:^|_)(\w)/\U$1$2/g$1}(){
return \$this->${1:val};
}
//Setter ${1:val}
public function set${1/(?:^|_)(\w)/\U$1$2/g$1}(\$${1:val}){
\$this->${1:val} = \$${1:val};
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>pSetGet</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