Last active
August 29, 2015 14:04
-
-
Save kublaios/118a7cf0ba769c1a65e7 to your computer and use it in GitHub Desktop.
Sublime Text PHP Getters and Setters Plugin Tiny Template
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
class camelCaseTiny(object): | |
name = "camelCaseTiny" | |
style = 'camelCase' # can also be snakeCase | |
getter = """ | |
public function get%(normalizedName)s() { return $this->%(name)s; }""" | |
setter = """ | |
public function set%(normalizedName)s(%(typeHint)s $%(name)s) { $this->%(name)s = $%(name)s; }""" |
Last step, set as default template under Sublime Text -> File -> Package Settings -> PHP Getters and Setters -> Settings - User
{
// user defined templates to load
"registerTemplates" : ["camelCaseTiny"],
// the template used to generate code
"template" : "camelCaseTiny",
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Save/override ~/Library/Application Support/Sublime Text 3/Packages/PHP Getters and Setters/user_templates.py