News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Rob Allen's Blog:
Sublime Text 2 Snippet for PHP getter and setter generation
January 03, 2012 @ 09:54:23

In a quick new post to his blog, Rob Allen has shared a snippet for the Sublime Text 2 editor to make creating getters and setters for your class simpler (dynamically too).

As with a lot of editors, Sublime Text supports snippets which are essentially text expansions of a short phrase into more text. I needed to create a few getXxx() and setXxx() methods for some properties of a class and decided that the easiest way to do this would be with a snippet.

Included in the post is the code you'll need to put into the snippet - a simple find (regular expression based) looks at the currently selected variable and expands out the getter and setter for it. For more information on the Sublime Text 2 editor, see the product's website.

0 comments voice your opinion now!
sublimetext2 editor snippet getter setter code


blog comments powered by Disqus

Similar Posts

Mark van der Velden's Blog: PHPUnit conditional test based on a PHP version

Patrick Allaert's Blog: Coding standards: converts PHP4 style constructors to PHP5 one

SitePoint Web Blog: Code Manifesto: Words to Live By

NetTuts.com: How to Write Testable and Maintainable Code in PHP

PHPMaster.com: Practical Refactoring, Part 1 - What is Good Code?


Community Events

Don't see your event here?
Let us know!


project example introduction yii2 podcast framework testing api community list opinion interview application language series laravel symfony part2 php7 composer

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework