Skip to content

Instantly share code, notes, and snippets.

@kublaios
Last active August 29, 2015 14:04
Show Gist options
  • Save kublaios/118a7cf0ba769c1a65e7 to your computer and use it in GitHub Desktop.
Save kublaios/118a7cf0ba769c1a65e7 to your computer and use it in GitHub Desktop.
Sublime Text PHP Getters and Setters Plugin Tiny Template
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; }"""
@kublaios
Copy link
Author

Save/override ~/Library/Application Support/Sublime Text 3/Packages/PHP Getters and Setters/user_templates.py

@kublaios
Copy link
Author

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